Paste your Java code in the text field below, and click "Score".
Tips: In most cases, repeated code can be eliminated by creating a 'wrapper' method that factors out the repetition. More...
For example, the following is a common theme:
try { ... }
catch (Exception ex) {
Logger.getLogger(XMLUtils.class.getName()).log(Level.SEVERE, null, ex);
}
|
In this case, the code inside the catch block could be placed inside another method and called when needed, eliminating the repetition:
private static void log (Exception ex) {
Logger.getLogger(XMLUtils.class.getName()).log(Level.SEVERE, null, ex);
}
|
try { ... }
catch (Exception ex) {
log(ex);
}
|
Less