for (ArtifactAction action : ArtifactAction.values()) { ArtifactAction a = ArtifactAction.valueOf(action.name()); assertEquals(0, a.compareTo(action)); assertEquals(action.ordinal(), a.ordinal()); }
for (UpdateChannel action : UpdateChannel.values()) { UpdateChannel a = UpdateChannel.valueOf(action.name()); assertEquals(0, a.compareTo(action)); assertEquals(action.ordinal(), a.ordinal()); }
Clone fragments detected by clone detection tool
File path: /sql12/test/src/net/sourceforge/squirrel_sql/client/update/gui/ArtifactActionTest.java File path: /sql12/test/src/net/sourceforge/squirrel_sql/client/update/UpdateChannelTest.java
Method name: void testEnumMethods() Method name: void testEnumMethods()
Number of AST nodes: 4 Number of AST nodes: 4
1
for (ArtifactAction action : ArtifactAction.values()) {
1
for (UpdateChannel action : UpdateChannel.values()) {
2
			ArtifactAction a = ArtifactAction.valueOf(action.name());
2
			UpdateChannel a = UpdateChannel.valueOf(action.name());
3
			assertEquals(0, a.compareTo(action));
3
			assertEquals(0, a.compareTo(action));
4
			assertEquals(action.ordinal(), a.ordinal());
4
			assertEquals(action.ordinal(), a.ordinal());
5
		}
5
		}
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.2
Clones locationClones are in different classes
Number of node comparisons16
  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.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    for (ArtifactAction action : ArtifactAction.values())
    1
    for (ArtifactAction action : ArtifactAction.values())
    1
    for (UpdateChannel action : UpdateChannel.values())
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.client.update.gui.ArtifactActionnet.sourceforge.squirrel_sql.client.update.UpdateChannelVARIABLE_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction[]net.sourceforge.squirrel_sql.client.update.UpdateChannel[]VARIABLE_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.client.update.gui.ArtifactActionnet.sourceforge.squirrel_sql.client.update.UpdateChannelVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction does not match with type net.sourceforge.squirrel_sql.client.update.UpdateChannel
    • Make classes net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction and net.sourceforge.squirrel_sql.client.update.UpdateChannel extend a common superclass
    Type net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction[] of variable ArtifactAction.values() does not match with type net.sourceforge.squirrel_sql.client.update.UpdateChannel[] of variable UpdateChannel.values()
    • Make classes net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction[] and net.sourceforge.squirrel_sql.client.update.UpdateChannel[] extend a common superclass
    Type net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction does not match with type net.sourceforge.squirrel_sql.client.update.UpdateChannel
    • Make classes net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction and net.sourceforge.squirrel_sql.client.update.UpdateChannel extend a common superclass
    1
    for (UpdateChannel action : UpdateChannel.values())
                                                                                                                    
    2
    UpdateChannel a = UpdateChannel.valueOf(action.name());
    Preondition Violations
    Unmatched statement UpdateChannel a=UpdateChannel.valueOf(action.name()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2
    UpdateChannel a = UpdateChannel.valueOf(action.name());
    2
    ArtifactAction a = ArtifactAction.valueOf(action.name());
    2
    ArtifactAction a = ArtifactAction.valueOf(action.name());
    Preondition Violations
    Unmatched statement ArtifactAction a=ArtifactAction.valueOf(action.name()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                        
    3
    assertEquals(0, a.compareTo(action));
    3
    assertEquals(0, a.compareTo(action));
    3
    assertEquals(0, a.compareTo(action));
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.client.update.gui.ArtifactActionnet.sourceforge.squirrel_sql.client.update.UpdateChannelVARIABLE_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.client.update.gui.ArtifactActionnet.sourceforge.squirrel_sql.client.update.UpdateChannelVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction of variable action does not match with type net.sourceforge.squirrel_sql.client.update.UpdateChannel of variable action
    • Make classes net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction and net.sourceforge.squirrel_sql.client.update.UpdateChannel extend a common superclass
    Type net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction of variable a does not match with type net.sourceforge.squirrel_sql.client.update.UpdateChannel of variable a
    • Make classes net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction and net.sourceforge.squirrel_sql.client.update.UpdateChannel extend a common superclass
    3
    assertEquals(0, a.compareTo(action));
    4
    assertEquals(action.ordinal(), a.ordinal());
    4
    assertEquals(action.ordinal(), a.ordinal());
    4
    assertEquals(action.ordinal(), a.ordinal());
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.client.update.gui.ArtifactActionnet.sourceforge.squirrel_sql.client.update.UpdateChannelVARIABLE_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.client.update.gui.ArtifactActionnet.sourceforge.squirrel_sql.client.update.UpdateChannelVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction of variable action does not match with type net.sourceforge.squirrel_sql.client.update.UpdateChannel of variable action
    • Make classes net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction and net.sourceforge.squirrel_sql.client.update.UpdateChannel extend a common superclass
    Type net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction of variable a does not match with type net.sourceforge.squirrel_sql.client.update.UpdateChannel of variable a
    • Make classes net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction and net.sourceforge.squirrel_sql.client.update.UpdateChannel extend a common superclass
    4
    assertEquals(action.ordinal(), a.ordinal());
    Precondition Violations (10)
    Row Violation
    1Type net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction does not match with type net.sourceforge.squirrel_sql.client.update.UpdateChannel
    2Type net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction[] of variable ArtifactAction.values() does not match with type net.sourceforge.squirrel_sql.client.update.UpdateChannel[] of variable UpdateChannel.values()
    3Type net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction does not match with type net.sourceforge.squirrel_sql.client.update.UpdateChannel
    4Unmatched statement UpdateChannel a=UpdateChannel.valueOf(action.name()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement ArtifactAction a=ArtifactAction.valueOf(action.name()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Type net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction of variable action does not match with type net.sourceforge.squirrel_sql.client.update.UpdateChannel of variable action
    7Type net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction of variable a does not match with type net.sourceforge.squirrel_sql.client.update.UpdateChannel of variable a
    8Type net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction of variable action does not match with type net.sourceforge.squirrel_sql.client.update.UpdateChannel of variable action
    9Type net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction of variable a does not match with type net.sourceforge.squirrel_sql.client.update.UpdateChannel of variable a
    10Clone fragment #1 returns variable action with type net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction , while Clone fragment #2 returns variable action with type net.sourceforge.squirrel_sql.client.update.UpdateChannel