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';
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.5
Clones locationClones are in different classes
Number of node comparisons33
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    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.8
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    4
    if (label == null)
    2
    if (label == null)
    5
    label = name;
    3
    label = name;
    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));
    else
    else
    11
    mnemonic = '\0';
    9
    mnemonic = '\0';
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables label, mnemonic , while Clone fragment #2 returns variables label, mnemonic