int result; if ((result = e1.set.compareToIgnoreCase(e2.set)) == 0) return e1.name.compareToIgnoreCase(e2.name); return result;
int result; if ((result = e1.status.compareToIgnoreCase(e2.status)) == 0) return compareNames(e1,e2); return result;
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/pluginmgr/InstallPanel.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/pluginmgr/ManagePanel.java
Method name: int compare(Object, Object) Method name: int compare(Object, Object)
Number of AST nodes: 4 Number of AST nodes: 4
1
int result;
1
int result;
2
				if ((result = e1.set.compareToIgnoreCase(e2.set)) == 0)
2
				if ((result = e1.status.compareToIgnoreCase(e2.status)) == 0)
3
					return e1.name.compareToIgnoreCase(e2.name);
3
					return compareNames(e1,e2);
4
				return result;
4
				return result;
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.7
Clones locationClones are in different classes
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    int result;
    5
    int result;
    6
    if ((result = e1.set.compareToIgnoreCase(e2.set)) == 0)
    6
    if ((result = e1.set.compareToIgnoreCase(e2.set)) == 0)
    6
    if ((result = e1.status.compareToIgnoreCase(e2.status)) == 0)
    Differences
    Expression1Expression2Difference
    org.gjt.sp.jedit.pluginmgr.InstallPanel.Entryorg.gjt.sp.jedit.pluginmgr.ManagePanel.EntryVARIABLE_TYPE_MISMATCH
    setstatusVARIABLE_NAME_MISMATCH
    org.gjt.sp.jedit.pluginmgr.InstallPanel.Entryorg.gjt.sp.jedit.pluginmgr.ManagePanel.EntryVARIABLE_TYPE_MISMATCH
    setstatusVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type java.lang.String of variable e2.set does not match with type java.lang.String of variable e2.status
    • Make classes org.gjt.sp.jedit.pluginmgr.InstallPanel.Entry and org.gjt.sp.jedit.pluginmgr.ManagePanel.Entry extend a common superclass
    Type java.lang.String of variable e1.set does not match with type java.lang.String of variable e1.status
    • Make classes org.gjt.sp.jedit.pluginmgr.InstallPanel.Entry and org.gjt.sp.jedit.pluginmgr.ManagePanel.Entry extend a common superclass
    6
    if ((result = e1.status.compareToIgnoreCase(e2.status)) == 0)
                                                                
    7
    return compareNames(e1, e2);
    Preondition Violations
    Unmatched statement return compareNames(e1,e2); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement return compareNames(e1,e2); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    Unmatched return compareNames(e1,e2);
    7
    return compareNames(e1, e2);
    7
    return e1.name.compareToIgnoreCase(e2.name);
    7
    return e1.name.compareToIgnoreCase(e2.name);
    Preondition Violations
    Unmatched statement return e1.name.compareToIgnoreCase(e2.name); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return e1.name.compareToIgnoreCase(e2.name);
                                                                                                  
    8
    return result;
    8
    return result;
    Precondition Violations (8)
    Row Violation
    1Type java.lang.String of variable e2.set does not match with type java.lang.String of variable e2.status
    2Type java.lang.String of variable e1.set does not match with type java.lang.String of variable e1.status
    3Unmatched statement return compareNames(e1,e2); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement return compareNames(e1,e2); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    5Unmatched return compareNames(e1,e2);
    6Unmatched statement return e1.name.compareToIgnoreCase(e2.name); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7Unmatched return e1.name.compareToIgnoreCase(e2.name);
    8Not all possible execution flows end in a return statement