for (int i = 0; i < tables.length; ++i) { ObjectTreeNode child = new ObjectTreeNode(session, tables[i]); child.setUserObject(getNodeDisplayText(stmt, tables[i])); childNodes.add(child); }
for (int i = 0; i < columns.length; i++) { TableColumnInfo info = columns[i]; String columnName = info.getColumnName(); result[i] = _dialect.getColumnDropSQL(tableName, columnName, _qualifier, _sqlPrefs); }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/expanders/TableTypeExpander.java File path: /sql12/plugins/refactoring/src/net/sourceforge/squirrel_sql/plugins/refactoring/commands/DropColumnCommand.java
Method name: List createChildren(ISession, ObjectTreeNode) Method name: String[] generateSQLStatements()
Number of AST nodes: 4 Number of AST nodes: 4
1
for (int i = 0; i < tables.length; ++i)
1
for (int i = 0; i < columns.length; i++)
2
			{
2
			{
3
				ObjectTreeNode child = new ObjectTreeNode(session, tables[i]);
3
				TableColumnInfo info = columns[i];
4
				child.setUserObj
4
				String columnName = info.getColumnName();
5
ect(getNodeDisplayText(stmt, tables[i]));
5
				result[i] = _dialect.get
6
				childNodes.add(child);
6
ColumnDropSQL(tableName, columnName, _qualifier, _sqlPrefs);
7
			}
7
			}
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)1.4
Clones locationClones are in different classes
Number of node comparisons17
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)26.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    14
    for (int i = 0; i < tables.length; ++i)
    14
    for (int i = 0; i < tables.length; ++i)
    5
    for (int i = 0; i < columns.length; i++)
    Differences
    Expression1Expression2Difference
    tablescolumnsVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.fw.sql.ITableInfo[]net.sourceforge.squirrel_sql.fw.sql.TableColumnInfo[]VARIABLE_TYPE_MISMATCH
    ++ii++AST_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.fw.sql.ITableInfo[]net.sourceforge.squirrel_sql.fw.sql.TableColumnInfo[]VARIABLE_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.fw.sql.ITableInfo[]net.sourceforge.squirrel_sql.fw.sql.TableColumnInfo[]VARIABLE_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.fw.sql.ITableInfo[]net.sourceforge.squirrel_sql.fw.sql.TableColumnInfo[]VARIABLE_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.fw.sql.ITableInfo[]net.sourceforge.squirrel_sql.fw.sql.TableColumnInfo[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable tables.length does not match with type int of variable columns.length
    • Make classes net.sourceforge.squirrel_sql.fw.sql.ITableInfo[] and net.sourceforge.squirrel_sql.fw.sql.TableColumnInfo[] extend a common superclass
    Type int of variable tables.length does not match with type int of variable columns.length
    • Make classes net.sourceforge.squirrel_sql.fw.sql.ITableInfo[] and net.sourceforge.squirrel_sql.fw.sql.TableColumnInfo[] extend a common superclass
    Type net.sourceforge.squirrel_sql.fw.sql.ITableInfo[] of variable tables does not match with type int of variable columns.length
    • Make classes net.sourceforge.squirrel_sql.fw.sql.ITableInfo[] and net.sourceforge.squirrel_sql.fw.sql.TableColumnInfo[] extend a common superclass
    Type net.sourceforge.squirrel_sql.fw.sql.ITableInfo[] of variable tables does not match with type int of variable columns.length
    • Make classes net.sourceforge.squirrel_sql.fw.sql.ITableInfo[] and net.sourceforge.squirrel_sql.fw.sql.TableColumnInfo[] extend a common superclass
    Type int of variable tables.length does not match with type net.sourceforge.squirrel_sql.fw.sql.TableColumnInfo[] of variable columns
    • Make classes net.sourceforge.squirrel_sql.fw.sql.ITableInfo[] and net.sourceforge.squirrel_sql.fw.sql.TableColumnInfo[] extend a common superclass
    5
    for (int i = 0; i < columns.length; i++)
                                                                          
    6
    TableColumnInfo info = columns[i];
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.fw.sql.ITableInfo[]net.sourceforge.squirrel_sql.fw.sql.TableColumnInfo[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable tables.length does not match with type net.sourceforge.squirrel_sql.fw.sql.TableColumnInfo[] of variable columns
    • Make classes net.sourceforge.squirrel_sql.fw.sql.ITableInfo[] and net.sourceforge.squirrel_sql.fw.sql.TableColumnInfo[] extend a common superclass
    6
    TableColumnInfo info = columns[i];
                                                                                        
    7
    String columnName = info.getColumnName();
    Preondition Violations
    Unmatched statement String columnName=info.getColumnName(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7
    String columnName = info.getColumnName();
                                                                                                                                                                        
    8
    result[i] = _dialect.getColumnDropSQL(tableName, columnName, _qualifier, _sqlPrefs);
    Preondition Violations
    Unmatched statement result[i]=_dialect.getColumnDropSQL(tableName,columnName,_qualifier,_sqlPrefs); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement result[i]=_dialect.getColumnDropSQL(tableName,columnName,_qualifier,_sqlPrefs); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    8
    result[i] = _dialect.getColumnDropSQL(tableName, columnName, _qualifier, _sqlPrefs);
    15
    ObjectTreeNode child = new ObjectTreeNode(session, tables[i]);
    15
    ObjectTreeNode child = new ObjectTreeNode(session, tables[i]);
    Preondition Violations
    Unmatched statement ObjectTreeNode child=new ObjectTreeNode(session,tables[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement ObjectTreeNode child=new ObjectTreeNode(session,tables[i]); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                                                                                  
    16
    child.setUserObject(getNodeDisplayText(stmt, tables[i]));
    16
    child.setUserObject(getNodeDisplayText(stmt, tables[i]));
    Preondition Violations
    Unmatched statement child.setUserObject(getNodeDisplayText(stmt,tables[i])); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                            
    17
    childNodes.add(child);
                                                        
    Precondition Violations (14)
    Row Violation
    1Type int of variable tables.length does not match with type int of variable columns.length
    2Type int of variable tables.length does not match with type int of variable columns.length
    3Type net.sourceforge.squirrel_sql.fw.sql.ITableInfo[] of variable tables does not match with type int of variable columns.length
    4Type net.sourceforge.squirrel_sql.fw.sql.ITableInfo[] of variable tables does not match with type int of variable columns.length
    5Type int of variable tables.length does not match with type net.sourceforge.squirrel_sql.fw.sql.TableColumnInfo[] of variable columns
    6Type int of variable tables.length does not match with type net.sourceforge.squirrel_sql.fw.sql.TableColumnInfo[] of variable columns
    7Unmatched statement String columnName=info.getColumnName(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8Unmatched statement result[i]=_dialect.getColumnDropSQL(tableName,columnName,_qualifier,_sqlPrefs); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    9Unmatched statement result[i]=_dialect.getColumnDropSQL(tableName,columnName,_qualifier,_sqlPrefs); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    10Unmatched statement ObjectTreeNode child=new ObjectTreeNode(session,tables[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    11Unmatched statement ObjectTreeNode child=new ObjectTreeNode(session,tables[i]); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    12Unmatched statement child.setUserObject(getNodeDisplayText(stmt,tables[i])); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    13Clone fragment #1 returns variables i , while Clone fragment #2 returns variables info, i
    14The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.expanders.TableTypeExpander and net.sourceforge.squirrel_sql.plugins.refactoring.commands.DropColumnCommand do not have a common superclass