if (dboType == null) { throw new IllegalArgumentException("Null DatabaseObjectType passed"); } if (action == null) { throw new IllegalArgumentException("Null Action passed"); } final JPopupMenu pop = getPopup(dboType, true); pop.add(action);
if (dboType == null) { throw new IllegalArgumentException("DatabaseObjectType == null"); } if (menu == null) { throw new IllegalArgumentException("JMenu == null"); } _tree.addToPopup(dboType, menu);
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/ObjectTree.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/ObjectTreePanel.java
Method name: void addToPopup(DatabaseObjectType, Action) Method name: void addToPopup(DatabaseObjectType, JMenu)
Number of AST nodes: 6 Number of AST nodes: 5
1
if (dboType == null)
1
if (dboType == null)
2
		{
2
		{
3
			throw new IllegalArgumentException("Null DatabaseObjectType passed");
3
			throw new IllegalArgumentException("DatabaseObjectType == null");
4
		}
4
		}
5
		if (action == null)
5
		if (menu == null)
6
		{
6
		{
7
			throw new IllegalArgumentException("Null Action passed");
7
			throw new IllegalArgumentException("JMenu == null");
8
		}
8
		}
9
		final JPopupMenu pop = getPopup(dboType, true);
9
		
10
		pop.add(action);
10
_tree.addToPopup(dboType, menu);
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.4
Clones locationClones are in different classes having the same super class
Number of node comparisons15
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.9
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (dboType == null)
    1
    if (dboType == null)
    2
    throw new IllegalArgumentException("Null DatabaseObjectType passed");
    2
    throw new IllegalArgumentException("Null DatabaseObjectType passed");
    2
    throw new IllegalArgumentException("DatabaseObjectType == null");
    Differences
    Expression1Expression2Difference
    "Null DatabaseObjectType passed""DatabaseObjectType == null"LITERAL_VALUE_MISMATCH
    2
    throw new IllegalArgumentException("DatabaseObjectType == null");
    3
    if (action == null)
    3
    if (action == null)
    3
    if (menu == null)
    Differences
    Expression1Expression2Difference
    actionmenuVARIABLE_NAME_MISMATCH
    javax.swing.Actionjavax.swing.JMenuVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type javax.swing.Action of variable action does not match with type javax.swing.JMenu of variable menu
    • Make classes javax.swing.Action and javax.swing.JMenu extend a common superclass
    3
    if (menu == null)
    4
    throw new IllegalArgumentException("Null Action passed");
    4
    throw new IllegalArgumentException("Null Action passed");
    4
    throw new IllegalArgumentException("JMenu == null");
    Differences
    Expression1Expression2Difference
    "Null Action passed""JMenu == null"LITERAL_VALUE_MISMATCH
    4
    throw new IllegalArgumentException("JMenu == null");
                                                                        
    5
    _tree.addToPopup(dboType, menu);
    Preondition Violations
    Unmatched statement _tree.addToPopup(dboType,menu); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5
    _tree.addToPopup(dboType, menu);
    5
    final JPopupMenu pop = getPopup(dboType, true);
    5
    final JPopupMenu pop = getPopup(dboType, true);
    Preondition Violations
    Unmatched statement final JPopupMenu pop=getPopup(dboType,true); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                  
    6
    pop.add(action);
    6
    pop.add(action);
    Preondition Violations
    Unmatched statement pop.add(action); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                          
    Precondition Violations (5)
    Row Violation
    1Type javax.swing.Action of variable action does not match with type javax.swing.JMenu of variable menu
    2Unmatched statement _tree.addToPopup(dboType,menu); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement final JPopupMenu pop=getPopup(dboType,true); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement pop.add(action); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTree and net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTreePanel do not have a common superclass