for (IMocksControl control : mockControls) { control.replay(); }
for (InstallStatusListener listener : _listeners) { listener.handleInstallStatusEvent(evt); }
Clone fragments detected by clone detection tool
File path: /sql12/test/src/utils/EasyMockHelper.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/update/gui/installer/ArtifactInstallerImpl.java
Method name: void replayAll() Method name: void sendEvent(InstallStatusEvent)
Number of AST nodes: 2 Number of AST nodes: 2
1
for (IMocksControl control : mockControls) {
1
for (I
2
         control.replay();
3
      
2
nstallStatusListener listener : _listeners)
3
		{
4
			listener.handleInstallStatusEvent(evt);
4
}
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 comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    for (IMocksControl control : mockControls)
    1
    for (IMocksControl control : mockControls)
    1
    for (InstallStatusListener listener : _listeners)
    Differences
    Expression1Expression2Difference
    org.easymock.IMocksControlnet.sourceforge.squirrel_sql.client.update.gui.installer.event.InstallStatusListenerVARIABLE_TYPE_MISMATCH
    mockControls_listenersVARIABLE_NAME_MISMATCH
    java.util.Listjava.util.ListVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.easymock.IMocksControl does not match with type net.sourceforge.squirrel_sql.client.update.gui.installer.event.InstallStatusListener
    • Make classes org.easymock.IMocksControl and net.sourceforge.squirrel_sql.client.update.gui.installer.event.InstallStatusListener extend a common superclass
    Type java.util.List<org.easymock.IMocksControl> of variable mockControls does not match with type java.util.List<net.sourceforge.squirrel_sql.client.update.gui.installer.event.InstallStatusListener> of variable _listeners
    • Make classes java.util.List and java.util.List extend a common superclass
    1
    for (InstallStatusListener listener : _listeners)
                                                                                        
    2
    listener.handleInstallStatusEvent(evt);
    Preondition Violations
    Unmatched statement listener.handleInstallStatusEvent(evt); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement listener.handleInstallStatusEvent(evt); 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
    2
    listener.handleInstallStatusEvent(evt);
    2
    control.replay();
    2
    control.replay();
    Preondition Violations
    Unmatched statement control.replay(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                            
    Precondition Violations (7)
    Row Violation
    1Type org.easymock.IMocksControl does not match with type net.sourceforge.squirrel_sql.client.update.gui.installer.event.InstallStatusListener
    2Type java.util.List<org.easymock.IMocksControl> of variable mockControls does not match with type java.util.List<net.sourceforge.squirrel_sql.client.update.gui.installer.event.InstallStatusListener> of variable _listeners
    3Unmatched statement listener.handleInstallStatusEvent(evt); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement listener.handleInstallStatusEvent(evt); 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 statement control.replay(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Clone fragment #1 returns variable control with type org.easymock.IMocksControl , while Clone fragment #2 returns variable listener with type net.sourceforge.squirrel_sql.client.update.gui.installer.event.InstallStatusListener
    7The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero