Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
15 | 2 | 1 | 0.952 | class_body_declaration |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 15 | 41 | plugins/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/comment/CommentFormatterUtil.java |
2 | 15 | 203 | plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/CodeFormatterUtil.java |
| ||||
/** * Evaluates the edit on the given string. * * @throws IllegalArgumentException if the positions are not inside the * string */ public static String evaluateFormatterEdit(String string, TextEdit edit, Position[] positions) { try { Document doc = createDocument(string, positions); edit.apply(doc, 0); if (positions != null) { for (int i = 0; i < positions.length; i++) { Assert.isTrue( !positions[i].isDeleted, "Position got deleted"); //$NON-NLS-1$ } } return doc.get(); } catch (BadLocationException e) { log(e); // bug in the formatter Assert.isTrue(false, "Formatter created edits with wrong positions: " + e.getMessage()); //$NON-NLS-1$ } return null; } |
| ||||
/** * Evaluates the edit on the given string. * @throws IllegalArgumentException If the positions are not inside the string, a * IllegalArgumentException is thrown. */ public static String evaluateFormatterEdit(String string, TextEdit edit, Position[] positions) { try { Document doc = createDocument(string, positions); edit.apply(doc, 0); if (positions != null) { for (int i = 0; i < positions.length; i++) { Assert.isTrue( !positions[i].isDeleted, "Position got deleted"); //$NON-NLS-1$ } } return doc.get(); } catch (BadLocationException e) { JavaPlugin.log(e); // bug in the formatter Assert.isTrue(false, "Formatter created edits with wrong positions: " + e.getMessage()); //$NON-NLS-1$ } return null; } |
| |||
/** * Evaluates the edit on the given string. * @throws IllegalArgumentException If the positions are not inside the string, a * IllegalArgumentException is thrown. */ /** * Evaluates the edit on the given string. * * @throws IllegalArgumentException if the positions are not inside the * string */ public static String evaluateFormatterEdit(String string, TextEdit edit, Position[] positions) { try { Document doc = createDocument(string, positions); edit.apply(doc, 0); if (positions != null) { for (int i = 0; i < positions.length; i++) { Assert.isTrue( !positions[i].isDeleted, "Position got deleted"); //$NON-NLS-1$ } } return doc.get(); } catch (BadLocationException e) { [[#variableb4411fc0]]; // bug in the formatter Assert.isTrue(false, "Formatter created edits with wrong positions: " + e.getMessage()); //$NON-NLS-1$ } return null; } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#b4411fc0]] | JavaPlugin.log(e) |
1 | 2 | [[#b4411fc0]] | log(e) |