for (DownloadStatusListener listener : listeners) { listener.handleDownloadStatusEvent(evt); }
for (InstallStatusListener listener : _listeners) { listener.handleInstallStatusEvent(evt); }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/update/downloader/ArtifactDownloaderImpl.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/update/gui/installer/ArtifactInstallerImpl.java
Method name: void sendEvent(DownloadStatusEvent) Method name: void sendEvent(InstallStatusEvent)
Number of AST nodes: 2 Number of AST nodes: 2
1
for (DownloadStatusListener listener : listeners)
1
for (InstallStatusListener listener : _listeners)
2
		{
2
		{
3
			listener.handleDownloadStatusEvent(evt);
3
			listener.handleInstallStatusEvent(evt);
4
		}
4
		}
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 statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)163.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    for (DownloadStatusListener listener : listeners)
    1
    for (DownloadStatusListener listener : listeners)
    1
    for (InstallStatusListener listener : _listeners)
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.client.update.downloader.event.DownloadStatusListenernet.sourceforge.squirrel_sql.client.update.gui.installer.event.InstallStatusListenerVARIABLE_TYPE_MISMATCH
    listeners_listenersVARIABLE_NAME_MISMATCH
    java.util.Listjava.util.ListVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.client.update.downloader.event.DownloadStatusListener does not match with type net.sourceforge.squirrel_sql.client.update.gui.installer.event.InstallStatusListener
    • Make classes net.sourceforge.squirrel_sql.client.update.downloader.event.DownloadStatusListener and net.sourceforge.squirrel_sql.client.update.gui.installer.event.InstallStatusListener extend a common superclass
    Type java.util.List<net.sourceforge.squirrel_sql.client.update.downloader.event.DownloadStatusListener> of variable listeners 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.handleDownloadStatusEvent(evt);
    2
    listener.handleDownloadStatusEvent(evt);
    2
    listener.handleInstallStatusEvent(evt);
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.client.update.downloader.event.DownloadStatusEventnet.sourceforge.squirrel_sql.client.update.gui.installer.event.InstallStatusEventVARIABLE_TYPE_MISMATCH
    handleDownloadStatusEventhandleInstallStatusEventMETHOD_INVOCATION_NAME_MISMATCH
    net.sourceforge.squirrel_sql.client.update.downloader.event.DownloadStatusListenernet.sourceforge.squirrel_sql.client.update.gui.installer.event.InstallStatusListenerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.client.update.downloader.event.DownloadStatusEvent of variable evt does not match with type net.sourceforge.squirrel_sql.client.update.gui.installer.event.InstallStatusEvent of variable evt
    • Make classes net.sourceforge.squirrel_sql.client.update.downloader.event.DownloadStatusEvent and net.sourceforge.squirrel_sql.client.update.gui.installer.event.InstallStatusEvent extend a common superclass
    Expression listener.handleDownloadStatusEvent(evt) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression listener.handleInstallStatusEvent(evt) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression listener.handleDownloadStatusEvent(evt) is a void method call, and thus it cannot be parameterized
    Expression listener.handleInstallStatusEvent(evt) is a void method call, and thus it cannot be parameterized
    Type net.sourceforge.squirrel_sql.client.update.downloader.event.DownloadStatusListener of variable listener does not match with type net.sourceforge.squirrel_sql.client.update.gui.installer.event.InstallStatusListener of variable listener
    • Make classes net.sourceforge.squirrel_sql.client.update.downloader.event.DownloadStatusListener and net.sourceforge.squirrel_sql.client.update.gui.installer.event.InstallStatusListener extend a common superclass
    2
    listener.handleInstallStatusEvent(evt);
    Precondition Violations (9)
    Row Violation
    1Type net.sourceforge.squirrel_sql.client.update.downloader.event.DownloadStatusListener does not match with type net.sourceforge.squirrel_sql.client.update.gui.installer.event.InstallStatusListener
    2Type java.util.List<net.sourceforge.squirrel_sql.client.update.downloader.event.DownloadStatusListener> of variable listeners does not match with type java.util.List<net.sourceforge.squirrel_sql.client.update.gui.installer.event.InstallStatusListener> of variable _listeners
    3Type net.sourceforge.squirrel_sql.client.update.downloader.event.DownloadStatusEvent of variable evt does not match with type net.sourceforge.squirrel_sql.client.update.gui.installer.event.InstallStatusEvent of variable evt
    4Expression listener.handleDownloadStatusEvent(evt) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression listener.handleInstallStatusEvent(evt) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression listener.handleDownloadStatusEvent(evt) is a void method call, and thus it cannot be parameterized
    7Expression listener.handleInstallStatusEvent(evt) is a void method call, and thus it cannot be parameterized
    8Type net.sourceforge.squirrel_sql.client.update.downloader.event.DownloadStatusListener of variable listener does not match with type net.sourceforge.squirrel_sql.client.update.gui.installer.event.InstallStatusListener of variable listener
    9The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.client.update.downloader.ArtifactDownloaderImpl and net.sourceforge.squirrel_sql.client.update.gui.installer.ArtifactInstallerImpl do not have a common superclass