Skip to content

Instantly share code, notes, and snippets.

@JxSun
JxSun / blog_asap_lod_1.java
Created April 22, 2018 15:34
A train wreck example in Clean Code
final String outputDir = ctxt.getOptions().getScratchDir().getAbsolutePath();
@JxSun
JxSun / blog_asap_lod_2.java
Created April 22, 2018 15:38
A solution to resolve a LoD violation in Clean Code
BufferedOutputStream bos = ctxt.createScratchFileStream(classFileName);
@JxSun
JxSun / blog_asap_lod_3.java
Created April 22, 2018 15:48
A StringBuilder example which does not break LoD
return new StringBuilder()
.append("example")
.delete(0, 2)
.insert(0, 's')
.toString();