if (lis == null) { throw new IllegalArgumentException("IObjectTreeListener == null"); } _tree.addObjectTreeListener(lis);
if (lis == null) { throw new IllegalArgumentException("TreeSelectionListener == null"); } _tree.addTreeSelectionListener(lis);
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/ObjectTreePanel.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/ObjectTreePanel.java
Method name: void addObjectTreeListener(IObjectTreeListener) Method name: void addTreeSelectionListener(TreeSelectionListener)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (lis == null)
1
if (lis == null)
2
		{
2
		{
3
			throw new IllegalArgumentException("IObjectTreeListener == null");
3
			throw new IllegalArgumentException("TreeSelectionListener == null");
4
		}
4
		}
5
		_tree.addObjectTreeListener(lis);
5
		_tree.addTreeSelectionListener(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)30.9
    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.mainpanel.objecttree.IObjectTreeListenerjavax.swing.event.TreeSelectionListenerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.IObjectTreeListener of variable lis does not match with type javax.swing.event.TreeSelectionListener of variable lis
    • Make classes net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.IObjectTreeListener and javax.swing.event.TreeSelectionListener extend a common superclass
    1
    if (lis == null)
    2
    throw new IllegalArgumentException("IObjectTreeListener == null");
    2
    throw new IllegalArgumentException("IObjectTreeListener == null");
    2
    throw new IllegalArgumentException("TreeSelectionListener == null");
    Differences
    Expression1Expression2Difference
    "IObjectTreeListener == null""TreeSelectionListener == null"LITERAL_VALUE_MISMATCH
    2
    throw new IllegalArgumentException("TreeSelectionListener == null");
    3
    _tree.addObjectTreeListener(lis);
    3
    _tree.addObjectTreeListener(lis);
    3
    _tree.addTreeSelectionListener(lis);
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.IObjectTreeListenerjavax.swing.event.TreeSelectionListenerVARIABLE_TYPE_MISMATCH
    addObjectTreeListeneraddTreeSelectionListenerMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.IObjectTreeListener of variable lis does not match with type javax.swing.event.TreeSelectionListener of variable lis
    • Make classes net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.IObjectTreeListener and javax.swing.event.TreeSelectionListener extend a common superclass
    Expression _tree.addObjectTreeListener(lis) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression _tree.addTreeSelectionListener(lis) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression _tree.addObjectTreeListener(lis) is a void method call, and thus it cannot be parameterized
    Expression _tree.addTreeSelectionListener(lis) is a void method call, and thus it cannot be parameterized
    3
    _tree.addTreeSelectionListener(lis);
    Precondition Violations (6)
    Row Violation
    1Type net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.IObjectTreeListener of variable lis does not match with type javax.swing.event.TreeSelectionListener of variable lis
    2Type net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.IObjectTreeListener of variable lis does not match with type javax.swing.event.TreeSelectionListener of variable lis
    3Expression _tree.addObjectTreeListener(lis) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression _tree.addTreeSelectionListener(lis) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression _tree.addObjectTreeListener(lis) is a void method call, and thus it cannot be parameterized
    6Expression _tree.addTreeSelectionListener(lis) is a void method call, and thus it cannot be parameterized