for (ArtifactAction action : ArtifactAction.values()) { ArtifactAction a = ArtifactAction.valueOf(action.name()); assertEquals(0, a.compareTo(action)); assertEquals(action.ordinal(), a.ordinal()); }
for (DownloadEventType action : DownloadEventType.values()) { DownloadEventType a = DownloadEventType.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/downloader/event/DownloadEventTypeTest.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 (
2
			ArtifactAction a = ArtifactAction
2
DownloadEventType action : DownloadEventType.values()) {
3
.valueOf(action.name());
3
			DownloadEventType a = DownloadEventType.valueOf(action.name());
4
			assertEquals(0, a.compareTo(action));
4
			assertEquals(0, a.compareTo(action));
5
			assertEquals(action.ordinal(), a.ordinal());
5
			assertEquals(action.ordinal(), a.ordinal());
6
		}
6
		}
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 (DownloadEventType action : DownloadEventType.values())
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.client.update.gui.ArtifactActionnet.sourceforge.squirrel_sql.client.update.downloader.event.DownloadEventTypeVARIABLE_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction[]net.sourceforge.squirrel_sql.client.update.downloader.event.DownloadEventType[]VARIABLE_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.client.update.gui.ArtifactActionnet.sourceforge.squirrel_sql.client.update.downloader.event.DownloadEventTypeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction does not match with type net.sourceforge.squirrel_sql.client.update.downloader.event.DownloadEventType
    • Make classes net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction and net.sourceforge.squirrel_sql.client.update.downloader.event.DownloadEventType 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.downloader.event.DownloadEventType[] of variable DownloadEventType.values()
    • Make classes net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction[] and net.sourceforge.squirrel_sql.client.update.downloader.event.DownloadEventType[] extend a common superclass
    Type net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction does not match with type net.sourceforge.squirrel_sql.client.update.downloader.event.DownloadEventType
    • Make classes net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction and net.sourceforge.squirrel_sql.client.update.downloader.event.DownloadEventType extend a common superclass
    1
    for (DownloadEventType action : DownloadEventType.values())
                                                                                                                                    
    2
    DownloadEventType a = DownloadEventType.valueOf(action.name());
    Preondition Violations
    Unmatched statement DownloadEventType a=DownloadEventType.valueOf(action.name()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2
    DownloadEventType a = DownloadEventType.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.downloader.event.DownloadEventTypeVARIABLE_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.client.update.gui.ArtifactActionnet.sourceforge.squirrel_sql.client.update.downloader.event.DownloadEventTypeVARIABLE_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.downloader.event.DownloadEventType of variable action
    • Make classes net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction and net.sourceforge.squirrel_sql.client.update.downloader.event.DownloadEventType 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.downloader.event.DownloadEventType of variable a
    • Make classes net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction and net.sourceforge.squirrel_sql.client.update.downloader.event.DownloadEventType 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.downloader.event.DownloadEventTypeVARIABLE_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.client.update.gui.ArtifactActionnet.sourceforge.squirrel_sql.client.update.downloader.event.DownloadEventTypeVARIABLE_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.downloader.event.DownloadEventType of variable action
    • Make classes net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction and net.sourceforge.squirrel_sql.client.update.downloader.event.DownloadEventType 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.downloader.event.DownloadEventType of variable a
    • Make classes net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction and net.sourceforge.squirrel_sql.client.update.downloader.event.DownloadEventType 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.downloader.event.DownloadEventType
    2Type net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction[] of variable ArtifactAction.values() does not match with type net.sourceforge.squirrel_sql.client.update.downloader.event.DownloadEventType[] of variable DownloadEventType.values()
    3Type net.sourceforge.squirrel_sql.client.update.gui.ArtifactAction does not match with type net.sourceforge.squirrel_sql.client.update.downloader.event.DownloadEventType
    4Unmatched statement DownloadEventType a=DownloadEventType.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.downloader.event.DownloadEventType 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.downloader.event.DownloadEventType 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.downloader.event.DownloadEventType 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.downloader.event.DownloadEventType 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.downloader.event.DownloadEventType