if (lis == null) { throw new IllegalArgumentException("IResultTabListener == null"); } _listeners.remove(IResultTabListener.class, lis);
if (lis == null) { throw new IllegalArgumentException("ISQLExecutionListener == null"); } _listeners.add(ISQLExecutionListener.class, lis);
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/SQLResultExecuterPanel.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/SQLResultExecuterPanel.java
Method name: void removeResultTabListener(IResultTabListener) Method name: void addSQLExecutionListener(ISQLExecutionListener)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (lis == null)
1
if (lis == null)
2
		{
2
		{
3
			throw new IllegalArgumentException("IResultTabListener == null");
3
			throw new IllegalArgumentException("ISQLExecutionListener == null");
4
		}
4
		}
5
		_listeners.remove(IResultTabListener.class, lis);
5
		_listeners.add(ISQLExecutionListener.class, lis);
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.1
Clones locationClones are declared in the same class
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (lis == null)
    1
    if (lis == null)
    1
    if (lis == null)
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.client.session.event.IResultTabListenernet.sourceforge.squirrel_sql.client.session.event.ISQLExecutionListenerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.client.session.event.IResultTabListener of variable lis does not match with type net.sourceforge.squirrel_sql.client.session.event.ISQLExecutionListener of variable lis
    • Make classes net.sourceforge.squirrel_sql.client.session.event.IResultTabListener and net.sourceforge.squirrel_sql.client.session.event.ISQLExecutionListener extend a common superclass
    1
    if (lis == null)
    2
    throw new IllegalArgumentException("IResultTabListener == null");
    2
    throw new IllegalArgumentException("IResultTabListener == null");
    2
    throw new IllegalArgumentException("ISQLExecutionListener == null");
    Differences
    Expression1Expression2Difference
    "IResultTabListener == null""ISQLExecutionListener == null"LITERAL_VALUE_MISMATCH
    2
    throw new IllegalArgumentException("ISQLExecutionListener == null");
    3
    _listeners.remove(IResultTabListener.class, lis);
    3
    _listeners.remove(IResultTabListener.class, lis);
    3
    _listeners.add(ISQLExecutionListener.class, lis);
    Differences
    Expression1Expression2Difference
    IResultTabListener.classISQLExecutionListener.classLITERAL_VALUE_MISMATCH
    net.sourceforge.squirrel_sql.client.session.event.IResultTabListenernet.sourceforge.squirrel_sql.client.session.event.ISQLExecutionListenerVARIABLE_TYPE_MISMATCH
    removeaddMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.client.session.event.IResultTabListener of variable lis does not match with type net.sourceforge.squirrel_sql.client.session.event.ISQLExecutionListener of variable lis
    • Make classes net.sourceforge.squirrel_sql.client.session.event.IResultTabListener and net.sourceforge.squirrel_sql.client.session.event.ISQLExecutionListener extend a common superclass
    Expression _listeners.remove(IResultTabListener.class,lis) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression _listeners.add(ISQLExecutionListener.class,lis) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression _listeners.remove(IResultTabListener.class,lis) is a void method call, and thus it cannot be parameterized
    Expression _listeners.add(ISQLExecutionListener.class,lis) is a void method call, and thus it cannot be parameterized
    3
    _listeners.add(ISQLExecutionListener.class, lis);
    Precondition Violations (6)
    Row Violation
    1Type net.sourceforge.squirrel_sql.client.session.event.IResultTabListener of variable lis does not match with type net.sourceforge.squirrel_sql.client.session.event.ISQLExecutionListener of variable lis
    2Type net.sourceforge.squirrel_sql.client.session.event.IResultTabListener of variable lis does not match with type net.sourceforge.squirrel_sql.client.session.event.ISQLExecutionListener of variable lis
    3Expression _listeners.remove(IResultTabListener.class,lis) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression _listeners.add(ISQLExecutionListener.class,lis) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression _listeners.remove(IResultTabListener.class,lis) is a void method call, and thus it cannot be parameterized
    6Expression _listeners.add(ISQLExecutionListener.class,lis) is a void method call, and thus it cannot be parameterized