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
			}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)1.1
Clones locationClones are in different classes having the same super class
Number of node comparisons30
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.0
    Clone typeType 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
    return null;
    7
    return null;
    else
    else
    8
    return shortcut2;
    8
    return shortcut2;
    else
    else
    9
    if (shortcut2 == null || shortcut2.length() == 0)
    9
    if (shortcut2 == null || shortcut2.length() == 0)
    10
    return shortcut1;
    10
    return shortcut1;
    else
    else
    11
    return shortcut1 + " or " + shortcut2;
    11
    return shortcut1 + " or " + shortcut2;
    Precondition Violations (0)
    Row Violation