switch(table.getTableHeader().columnAtPoint(evt.getPoint())) { case 1: pluginModel.setSortType(EntryCompare.NAME); break; case 3: pluginModel.setSortType(EntryCompare.STATUS); break; default: break; }
switch(table.getTableHeader().columnAtPoint(evt.getPoint())) { case 1: pluginModel.sort(EntryCompare.NAME); break; case 2: pluginModel.sort(EntryCompare.CATEGORY); break; default: }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/pluginmgr/ManagePanel.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/pluginmgr/InstallPanel.java
Method name: void mouseClicked(MouseEvent) Method name: void mouseClicked(MouseEvent)
Number of AST nodes: 9 Number of AST nodes: 8
1
switch(table.getTableHeader().columnAtPoint(evt.getPoint()))
1
switch(table.getTableHeader().columnAtPoint(evt.getPoint()))
2
			{
2
			{
3
				case 1:
3
				case 1:
4
					pluginModel.setSortType(EntryCompare.NAME);
4
					pluginModel.sort(EntryCompare.NAME);
5
					break;
5
					break;
6
				case 3:
6
				case 2:
7
					pluginModel.setSortType(EntryCompare.STATUS);
7
					pluginModel.sort(EntryCompare.CATEGORY);
8
					break;
8
					break;
9
				default:
9
				default:
10
					break;
10
			
11
			}
11
}
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.8
Clones locationClones are in different classes having the same super class
Number of node comparisons36
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)4.2
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    switch (table.getTableHeader().columnAtPoint(evt.getPoint()))
    1
    switch (table.getTableHeader().columnAtPoint(evt.getPoint()))
    2
    case 1:
    2
    case 1:
    3
    pluginModel.setSortType(EntryCompare.NAME);
    3
    pluginModel.setSortType(EntryCompare.NAME);
    3
    pluginModel.sort(EntryCompare.NAME);
    Differences
    Expression1Expression2Difference
    setSortTypesortMETHOD_INVOCATION_NAME_MISMATCH
    org.gjt.sp.jedit.pluginmgr.ManagePanel.EntryCompareorg.gjt.sp.jedit.pluginmgr.InstallPanel.EntryCompareVARIABLE_TYPE_MISMATCH
    org.gjt.sp.jedit.pluginmgr.ManagePanel.PluginTableModelorg.gjt.sp.jedit.pluginmgr.InstallPanel.PluginTableModelSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression pluginModel.setSortType(EntryCompare.NAME) is a void method call, and thus it cannot be parameterized
    Expression pluginModel.sort(EntryCompare.NAME) is a void method call, and thus it cannot be parameterized
    Type org.gjt.sp.jedit.pluginmgr.ManagePanel.EntryCompare of variable EntryCompare does not match with type org.gjt.sp.jedit.pluginmgr.InstallPanel.EntryCompare of variable EntryCompare
    • Make classes org.gjt.sp.jedit.pluginmgr.ManagePanel.EntryCompare and org.gjt.sp.jedit.pluginmgr.InstallPanel.EntryCompare extend a common superclass
    3
    pluginModel.sort(EntryCompare.NAME);
    4
    break;
    4
    break;
    5
    case 3:
    5
    case 3:
    5
    case 2:
    Differences
    Expression1Expression2Difference
    32LITERAL_VALUE_MISMATCH
    5
    case 2:
    6
    pluginModel.setSortType(EntryCompare.STATUS);
    6
    pluginModel.setSortType(EntryCompare.STATUS);
    6
    pluginModel.sort(EntryCompare.CATEGORY);
    Differences
    Expression1Expression2Difference
    setSortTypesortMETHOD_INVOCATION_NAME_MISMATCH
    org.gjt.sp.jedit.pluginmgr.ManagePanel.EntryCompareorg.gjt.sp.jedit.pluginmgr.InstallPanel.EntryCompareVARIABLE_TYPE_MISMATCH
    STATUSCATEGORYVARIABLE_NAME_MISMATCH
    org.gjt.sp.jedit.pluginmgr.ManagePanel.PluginTableModelorg.gjt.sp.jedit.pluginmgr.InstallPanel.PluginTableModelSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression pluginModel.setSortType(EntryCompare.STATUS) is a void method call, and thus it cannot be parameterized
    Expression pluginModel.sort(EntryCompare.CATEGORY) is a void method call, and thus it cannot be parameterized
    Type org.gjt.sp.jedit.pluginmgr.ManagePanel.EntryCompare of variable EntryCompare does not match with type org.gjt.sp.jedit.pluginmgr.InstallPanel.EntryCompare of variable EntryCompare
    • Make classes org.gjt.sp.jedit.pluginmgr.ManagePanel.EntryCompare and org.gjt.sp.jedit.pluginmgr.InstallPanel.EntryCompare extend a common superclass
    6
    pluginModel.sort(EntryCompare.CATEGORY);
    7
    break;
    7
    break;
    8
    default:
    8
    default:
    9
    break;
    9
    break;
    Preondition Violations
    Unmatched break;
                      
    Precondition Violations (7)
    Row Violation
    1Expression pluginModel.setSortType(EntryCompare.NAME) is a void method call, and thus it cannot be parameterized
    2Expression pluginModel.sort(EntryCompare.NAME) is a void method call, and thus it cannot be parameterized
    3Type org.gjt.sp.jedit.pluginmgr.ManagePanel.EntryCompare of variable EntryCompare does not match with type org.gjt.sp.jedit.pluginmgr.InstallPanel.EntryCompare of variable EntryCompare
    4Expression pluginModel.setSortType(EntryCompare.STATUS) is a void method call, and thus it cannot be parameterized
    5Expression pluginModel.sort(EntryCompare.CATEGORY) is a void method call, and thus it cannot be parameterized
    6Type org.gjt.sp.jedit.pluginmgr.ManagePanel.EntryCompare of variable EntryCompare does not match with type org.gjt.sp.jedit.pluginmgr.InstallPanel.EntryCompare of variable EntryCompare
    7Unmatched break;