if(label == null)
label = name;
char mnemonic;
int index = label.indexOf('$');
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(label == null)
label = name;
char mnemonic;
int index = label.indexOf('$');
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: 8
|
|
Number of AST nodes: 8
|
|
1 | if(label == null)↵ | | 1 | if(label == null)↵
|
2 | label = name;↵ | | 2 | label = name;↵
|
|
3 | char mnemonic;↵ | | 3 | char mnemonic;↵
|
4 | int index = label.indexOf('$');↵ | | 4 | int index = label.indexOf('$');↵
|
5 | if(index != -1 && label.length() - index > 1)↵ | | 5 | if(index != -1 && label.length() - index > 1)↵
|
6 | {↵ | | 6 | {↵
|
7 | mnemonic = Character.toLowerCase(label.charAt(index + 1));↵ | | 7 | mnemonic = Character.toLowerCase(label.charAt(index + 1));↵
|
8 | label = label.substring(0,index).concat(label.substring(++index));↵ | | 8 | label = label.substring(0,index).concat(label.substring(++index));↵
|
9 | }↵ | | 9 | }↵
|
10 | else↵ | | 10 | else↵
|
11 | mnemonic = '\0'; | | 11 | 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.5 |
Clones location | Clones are in different classes |
Number of node comparisons | 33 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 8 |
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.8 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
4 | if (label == null) | | 2 | if (label == null) |
5 | | | 3 | |
6 | char mnemonic; | | 4 | char mnemonic; |
7 | int index = label.indexOf('$'); | | 5 | int index = label.indexOf('$'); |
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 |