localColumBox.removeAllItems(); for (String colum : localColums) { localColumBox.addItem(colum); }
_con.close(); for (ConnectionListener listener : _listeners) { listener.connectionClosed(); }
Clone fragments detected by clone detection tool
File path: /sql12/plugins/refactoring/src/net/sourceforge/squirrel_sql/plugins/refactoring/gui/AddUniqueConstraintDialog.java File path: /sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/HibernateTabController.java
Method name: void setLocalColumns(String[]) Method name: void closeConnection()
Number of AST nodes: 3 Number of AST nodes: 3
1
localColumBox.removeAllItems();
2
			for (String colum : localColums)
3
			{
4
				localColumBox.addItem(colum);
5
			
1
_con.close();
2
      for (ConnectionListener listener : _listeners)
3
      {
4
         listener.connectionClosed();
6
}
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 comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)1.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                    
    1
    _con.close();
    Preondition Violations
    Unmatched statement _con.close(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    1
    _con.close();
    1
    localColumBox.removeAllItems();
                                                                        
    2
    for (String colum : localColums)
    2
    for (String colum : localColums)
    2
    for (ConnectionListener listener : _listeners)
    Differences
    Expression1Expression2Difference
    java.lang.Stringnet.sourceforge.squirrel_sql.plugins.hibernate.ConnectionListenerVARIABLE_TYPE_MISMATCH
    localColums_listenersVARIABLE_NAME_MISMATCH
    java.lang.String[]java.util.ArrayListVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String does not match with type net.sourceforge.squirrel_sql.plugins.hibernate.ConnectionListener
    • Make classes java.lang.String and net.sourceforge.squirrel_sql.plugins.hibernate.ConnectionListener extend a common superclass
    Type java.lang.String[] of variable localColums does not match with type java.util.ArrayList<net.sourceforge.squirrel_sql.plugins.hibernate.ConnectionListener> of variable _listeners
    • Make classes java.lang.String[] and java.util.ArrayList extend a common superclass
    2
    for (ConnectionListener listener : _listeners)
                                                                  
    3
    listener.connectionClosed();
    Preondition Violations
    Unmatched statement listener.connectionClosed(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3
    listener.connectionClosed();
    3
    localColumBox.addItem(colum);
    3
    localColumBox.addItem(colum);
    Preondition Violations
    Unmatched statement localColumBox.addItem(colum); 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
    1Unmatched statement _con.close(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Type java.lang.String does not match with type net.sourceforge.squirrel_sql.plugins.hibernate.ConnectionListener
    3Type java.lang.String[] of variable localColums does not match with type java.util.ArrayList<net.sourceforge.squirrel_sql.plugins.hibernate.ConnectionListener> of variable _listeners
    4Unmatched statement listener.connectionClosed(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement localColumBox.addItem(colum); 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 colum with type java.lang.String , while Clone fragment #2 returns variable listener with type net.sourceforge.squirrel_sql.plugins.hibernate.ConnectionListener
    7The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero