Intuition tells us that methods like these ones suffer from a distinct code smell: CompilationTask getTask( Writer out, JavaFileManager fileManager, DiagnosticListener<? super JavaFileObject> diagnosticListener, Iterable<String> options, Iterable<String> classes, Iterable<? extends JavaFileObject> compilationUnits ); Why is that so? Let's delve into this intuition. Here is an example from the JavaCompiler Javadoc: Iterable<? extends JavaFileObject> compilationUnits1 = … Continue reading How to Eliminate Bugs Through High Cohesion
Tag: Metrics
Silly Metrics: The Most Used Java Keywords
Tell me... Haven't you ever wondered how many times you actually "synchronized" something? Didn't you worry about not using the "do {} while ()" loop structure often enough? Are you an expert in applying "volatile"? Do you "catch" more often than you "try"? Is your program rather "true" or rather "false? And how did that "goto" … Continue reading Silly Metrics: The Most Used Java Keywords