String[] result = new String[infos.length]; for (int i = 0; i < result.length; i++) { result[i] = infos[i].getSimpleName(); } return result;
String[] result = new String[dbInfo.length]; for (int i = 0; i < result.length; i++) { result[i] = dbInfo[i].getSimpleName(); } return result;
Clone fragments detected by clone detection tool
File path: /sql12/plugins/postgres/src/net/sourceforge/squirrel_sql/plugins/postgres/gui/VacuumTableDialog.java File path: /sql12/plugins/refactoring/src/net/sourceforge/squirrel_sql/plugins/refactoring/gui/DefaultDropDialog.java
Method name: String[] getSimpleNames(ITableInfo[]) Method name: String[] getSimpleNames(IDatabaseObjectInfo[])
Number of AST nodes: 4 Number of AST nodes: 4
1
String[] result = new String[infos.length];
1
String[] result = new String[dbInfo.length];
2
        for (int i = 0; i < result.length; i++) {
2
        for (int i = 0; i < result.length; i++) {
3
            result[i] = infos[i].getSimpleName();
3
            result[i] = dbInfo[i].getSimpleName();
4
        }
4
        }
5
        return result;
5
        return result;
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 having the same super class
Number of node comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    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.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    String[] result = new String[infos.length];
    1
    String[] result = new String[infos.length];
    1
    String[] result = new String[dbInfo.length];
    Differences
    Expression1Expression2Difference
    infosdbInfoVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.fw.sql.ITableInfo[]net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable infos.length does not match with type int of variable dbInfo.length
    • Make classes net.sourceforge.squirrel_sql.fw.sql.ITableInfo[] and net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo[] extend a common superclass
    1
    String[] result = new String[dbInfo.length];
    2
    for (int i = 0; i < result.length; i++)
    2
    for (int i = 0; i < result.length; i++)
    3
    result[i] = infos[i].getSimpleName();
    3
    result[i] = infos[i].getSimpleName();
    3
    result[i] = dbInfo[i].getSimpleName();
    Differences
    Expression1Expression2Difference
    infosdbInfoVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.fw.sql.ITableInfo[]net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.fw.sql.ITableInfo[] of variable infos does not match with type net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo[] of variable dbInfo
    • Make classes net.sourceforge.squirrel_sql.fw.sql.ITableInfo[] and net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo[] extend a common superclass
    3
    result[i] = dbInfo[i].getSimpleName();
    4
    return result;
    4
    return result;
    Precondition Violations (3)
    Row Violation
    1Type int of variable infos.length does not match with type int of variable dbInfo.length
    2Type net.sourceforge.squirrel_sql.fw.sql.ITableInfo[] of variable infos does not match with type net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo[] of variable dbInfo
    3The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.plugins.postgres.gui.VacuumTableDialog and net.sourceforge.squirrel_sql.plugins.refactoring.gui.DefaultDropDialog do not have a common superclass