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.5
Clones locationClones are in different classes
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    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.6
    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 org.gjt.sp.jedit.pluginmgr.InstallPanel.Entry of variable e2 does not match with type org.gjt.sp.jedit.pluginmgr.ManagePanel.Entry of variable e2
    • Make classes org.gjt.sp.jedit.pluginmgr.InstallPanel.Entry and org.gjt.sp.jedit.pluginmgr.ManagePanel.Entry extend a common superclass
    Type org.gjt.sp.jedit.pluginmgr.InstallPanel.Entry of variable e1 does not match with type org.gjt.sp.jedit.pluginmgr.ManagePanel.Entry of variable e1
    • 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 e1.name.compareToIgnoreCase(e2.name);
    7
    return e1.name.compareToIgnoreCase(e2.name);
    7
    return compareNames(e1, e2);
    Differences
    Expression1Expression2Difference
    compareToIgnoreCasecompareNamesMETHOD_INVOCATION_NAME_MISMATCH
    e1.name.compareToIgnoreCase(e2.name)compareNames(e1,e2)ARGUMENT_NUMBER_MISMATCH
    e1.nameMISSING_METHOD_INVOCATION_EXPRESSION
    7
    return compareNames(e1, e2);
    8
    return result;
    8
    return result;
    Precondition Violations (2)
    Row Violation
    1Type org.gjt.sp.jedit.pluginmgr.InstallPanel.Entry of variable e2 does not match with type org.gjt.sp.jedit.pluginmgr.ManagePanel.Entry of variable e2
    2Type org.gjt.sp.jedit.pluginmgr.InstallPanel.Entry of variable e1 does not match with type org.gjt.sp.jedit.pluginmgr.ManagePanel.Entry of variable e1