if(shortcut1 == null || shortcut1.length() == 0)
{
if(shortcut2 == null || shortcut2.length() == 0)
return null;
else
return shortcut2;
}
else
{
if(shortcut2 == null || shortcut2.length() == 0)
return shortcut1;
else
return shortcut1 + " or " + shortcut2;
}
if(shortcut1 == null || shortcut1.length() == 0)
{
if(shortcut2 == null || shortcut2.length() == 0)
return null;
else
return shortcut2;
}
else
{
if(shortcut2 == null || shortcut2.length() == 0)
return shortcut1;
else
return shortcut1 + " or " + shortcut2;
}
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/menu/EnhancedCheckBoxMenuItem.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/menu/EnhancedMenuItem.java
|
Method name: String getShortcut()
|
|
Method name: String getShortcut()
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | if(shortcut1 == null || shortcut1.length() == 0)↵ | | 1 | if(shortcut1 == null || shortcut1.length() == 0)↵
|
2 | {↵ | | 2 | {↵
|
3 | if(shortcut2 == null || shortcut2.length() == 0)↵ | | 3 | if(shortcut2 == null || shortcut2.length() == 0)↵
|
4 | return null;↵ | | 4 | return null;↵
|
5 | else↵ | | 5 | else↵
|
6 | return shortcut2;↵ | | 6 | return shortcut2;↵
|
7 | }↵ | | 7 | }↵
|
8 | else↵ | | 8 | else↵
|
9 | {↵ | | 9 | {↵
|
10 | if(shortcut2 == null || shortcut2.length() == 0)↵ | | 10 | if(shortcut2 == null || shortcut2.length() == 0)↵
|
11 | return shortcut1;↵ | | 11 | return shortcut1;↵
|
12 | else↵ | | 12 | else↵
|
13 | return shortcut1 + " or " + shortcut2;↵ | | 13 | return shortcut1 + " or " + shortcut2;↵
|
14 | } | | 14 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 1.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 30 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 7 |
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.0 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
5 | if (shortcut1 == null || shortcut1.length() == 0) | | 5 | if (shortcut1 == null || shortcut1.length() == 0) |
6 | if (shortcut2 == null || shortcut2.length() == 0) | | 6 | if (shortcut2 == null || shortcut2.length() == 0) |
7 | | | 7 | |
| | | | |
8 | | | 8 | |
| | | | |
9 | if (shortcut2 == null || shortcut2.length() == 0) | | 9 | if (shortcut2 == null || shortcut2.length() == 0) |
10 | | | 10 | |
| | | | |
11 | return shortcut1 + " or " + shortcut2; | | 11 | return shortcut1 + " or " + shortcut2; |
Precondition Violations (0)
Row |
Violation |