if(index != -1 && label.length() - index > 1)
{
mnemonic = Character.toLowerCase(label.charAt(index + 1));
label = label.substring(0,index).concat(label.substring(++index));
}
else
mnemonic = '\0';
if(index != -1 && label.length() - index > 1)
{
mnemonic = Character.toLowerCase(label.charAt(index + 1));
label = label.substring(0,index).concat(label.substring(++index));
}
else
mnemonic = '\0';
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/GUIUtilities.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/menu/EnhancedMenu.java
|
Method name: JMenuItem loadMenuItem(ActionContext, String, boolean)
|
|
Method name: void EnhancedMenu(String, String, ActionContext)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | if(index != -1 && label.length() - index > 1)↵ | | 1 | if(index != -1 && label.length() - index > 1)↵
|
2 | {↵ | | 2 | {↵
|
3 | mnemonic = Character.toLowerCase(label.charAt(index + 1));↵ | | 3 | mnemonic = Character.toLowerCase(label.charAt(index + 1));↵
|
4 | label = label.substring(0,index).concat(label.substring(++index));↵ | | 4 | label = label.substring(0,index).concat(label.substring(++index));↵
|
5 | }↵ | | 5 | }↵
|
6 | else↵ | | 6 | else↵
|
7 | mnemonic = '\0'; | | 7 | mnemonic = '\0';
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 16 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.2 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
8 | if (index != -1 && label.length() - index > 1) | | 6 | if (index != -1 && label.length() - index > 1) |
9 | mnemonic = Character.toLowerCase(label.charAt(index + 1)); | | 7 | mnemonic = Character.toLowerCase(label.charAt(index + 1)); |
10 | label = label.substring(0, index).concat(label.substring(++index)); | | 8 | label = label.substring(0, index).concat(label.substring(++index)); |
| | | | |
11 | | | 9 | |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables label, mnemonic , while Clone fragment #2 returns variables label, mnemonic |