| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 22 | 2 | 6 | 0.974 | class_body_declarations[2] |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 22 | 775 | plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/LineWrappingTabPage.java |
| 2 | 22 | 799 | plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/LineWrappingTabPage.java |
| ||||
protected void wrappingStyleChanged(int wrappingStyle) {
Iterator iterator = fSelectionState.fElements.iterator();
String currentKey;
while (iterator.hasNext()) {
currentKey = ((Category) iterator.next()).key;
try {
changeWrappingStyle(currentKey, wrappingStyle);
} catch (IllegalArgumentException e) {
fWorkingValues.put(currentKey, DefaultCodeFormatterConstants.createAlignmentValue(false, wrappingStyle, DefaultCodeFormatterConstants.INDENT_DEFAULT));
JavaPlugin.log(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), IStatus.OK,
Messages.format(FormatterMessages.LineWrappingTabPage_error_invalid_value, currentKey), e));
}
}
fSelectionState.refreshState(fSelection);
}
private void changeWrappingStyle(String currentKey, int wrappingStyle) throws IllegalArgumentException {
String value = (String) fWorkingValues.get(currentKey);
value = DefaultCodeFormatterConstants.setWrappingStyle(value, wrappingStyle);
if (value == null)
throw new IllegalArgumentException();
fWorkingValues.put(currentKey, value);
}
|
| ||||
protected void indentStyleChanged(int indentStyle) {
Iterator iterator = fSelectionState.fElements.iterator();
String currentKey;
while (iterator.hasNext()) {
currentKey = ((Category) iterator.next()).key;
try {
changeIndentStyle(currentKey, indentStyle);
} catch (IllegalArgumentException e) {
fWorkingValues.put(currentKey, DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_NO_SPLIT, indentStyle));
JavaPlugin.log(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), IStatus.OK,
Messages.format(FormatterMessages.LineWrappingTabPage_error_invalid_value, currentKey), e));
}
}
fSelectionState.refreshState(fSelection);
}
private void changeIndentStyle(String currentKey, int indentStyle) throws IllegalArgumentException {
String value = (String) fWorkingValues.get(currentKey);
value = DefaultCodeFormatterConstants.setIndentStyle(value, indentStyle);
if (value == null)
throw new IllegalArgumentException();
fWorkingValues.put(currentKey, value);
}
|
| |||
protected void [[#variablebd9f6360]](int [[#variablebd9f62e0]]) {
Iterator iterator = fSelectionState.fElements.iterator();
String currentKey;
while (iterator.hasNext()) {
currentKey = ((Category) iterator.next()).key;
try {
[[#variablebd9f61e0]](currentKey, [[#variablebd9f62e0]]);
}
catch (IllegalArgumentException e) {
fWorkingValues.put(currentKey, DefaultCodeFormatterConstants.createAlignmentValue(false, [[#variablebd9f6200]], [[#variablebd9f61a0]]));
JavaPlugin.log(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), IStatus.OK, Messages.format(FormatterMessages.LineWrappingTabPage_error_invalid_value, currentKey), e));
}
}
fSelectionState.refreshState(fSelection);
}
private void [[#variablebd9f61e0]](String currentKey, int [[#variablebd9f62e0]]) throws IllegalArgumentException {
String value = (String) fWorkingValues.get(currentKey);
value = DefaultCodeFormatterConstants. [[#variablebd9f6160]](value, [[#variablebd9f62e0]]);
if (value == null)
throw new IllegalArgumentException();
fWorkingValues.put(currentKey, value);
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#bd9f6360]] | indentStyleChanged |
| 1 | 2 | [[#bd9f6360]] | wrappingStyleChanged |
| 2 | 1 | [[#bd9f62e0]] | indentStyle |
| 2 | 2 | [[#bd9f62e0]] | wrappingStyle |
| 3 | 1 | [[#bd9f61e0]] | changeIndentStyle |
| 3 | 2 | [[#bd9f61e0]] | changeWrappingStyle |
| 4 | 1 | [[#bd9f6200]] | DefaultCodeFormatterConstants.WRAP_NO_SPLIT |
| 4 | 2 | [[#bd9f6200]] | wrappingStyle |
| 5 | 1 | [[#bd9f61a0]] | indentStyle |
| 5 | 2 | [[#bd9f61a0]] | DefaultCodeFormatterConstants.INDENT_DEFAULT |
| 6 | 1 | [[#bd9f6160]] | setIndentStyle |
| 6 | 2 | [[#bd9f6160]] | setWrappingStyle |