String[] ret = new String[_propertyInfos.length]; for (int i = 0; i < _propertyInfos.length; i++) { ret[i] = _propertyInfos[i].getCompareString(); } return ret;
String[] result = new String[infos.length]; for (int i = 0; i < result.length; i++) { result[i] = infos[i].getSimpleName(); } return result;
Clone fragments detected by clone detection tool
File path: /sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/mapping/MappedClassInfo.java File path: /sql12/plugins/postgres/src/net/sourceforge/squirrel_sql/plugins/postgres/gui/VacuumTableDialog.java
Method name: String[] getAttributeNames() Method name: String[] getSimpleNames(ITableInfo[])
Number of AST nodes: 4 Number of AST nodes: 4
1
String[] ret = new String[_propertyInfos.length];
1
String[] result = new String[infos.length];
2
      for (int i = 0; i < _propertyInfos.length; i++)
2
        for (int i = 0; i < result.length; i++)
3
   
3
 {
4
   {
4
   
5
         ret[i] = _propertyInfos[i].getCompareString();
5
         result[i] = infos[i].get
6
SimpleName();
6
      }
7
        }
8

7
      return ret;
9
        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
Number of node comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    String[] ret = new String[_propertyInfos.length];
    1
    String[] ret = new String[_propertyInfos.length];
    1
    String[] result = new String[infos.length];
    Differences
    Expression1Expression2Difference
    retresultVARIABLE_NAME_MISMATCH
    _propertyInfosinfosVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.plugins.hibernate.mapping.PropertyInfo[]net.sourceforge.squirrel_sql.fw.sql.ITableInfo[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable _propertyInfos.length does not match with type int of variable infos.length
    • Make classes net.sourceforge.squirrel_sql.plugins.hibernate.mapping.PropertyInfo[] and net.sourceforge.squirrel_sql.fw.sql.ITableInfo[] extend a common superclass
    1
    String[] result = new String[infos.length];
    2
    for (int i = 0; i < _propertyInfos.length; i++)
    2
    for (int i = 0; i < _propertyInfos.length; i++)
    2
    for (int i = 0; i < result.length; i++)
    Differences
    Expression1Expression2Difference
    _propertyInfosresultVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.plugins.hibernate.mapping.PropertyInfo[]java.lang.String[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression result.length cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type int of variable _propertyInfos.length does not match with type int of variable result.length
    • Make classes net.sourceforge.squirrel_sql.plugins.hibernate.mapping.PropertyInfo[] and java.lang.String[] extend a common superclass
    2
    for (int i = 0; i < result.length; i++)
                                                                                
    3
    result[i] = infos[i].getSimpleName();
    Preondition Violations
    Unmatched statement result[i]=infos[i].getSimpleName(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3
    result[i] = infos[i].getSimpleName();
    3
    ret[i] = _propertyInfos[i].getCompareString();
    3
    ret[i] = _propertyInfos[i].getCompareString();
    Preondition Violations
    Unmatched statement ret[i]=_propertyInfos[i].getCompareString(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                  
    4
    return ret;
    4
    return ret;
    4
    return result;
    Differences
    Expression1Expression2Difference
    retresultVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression ret cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression result cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    return result;
    Precondition Violations (8)
    Row Violation
    1Type int of variable _propertyInfos.length does not match with type int of variable infos.length
    2Expression result.length cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Type int of variable _propertyInfos.length does not match with type int of variable result.length
    4Unmatched statement result[i]=infos[i].getSimpleName(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement ret[i]=_propertyInfos[i].getCompareString(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Expression ret cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression result cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.plugins.hibernate.mapping.MappedClassInfo and net.sourceforge.squirrel_sql.plugins.postgres.gui.VacuumTableDialog do not have a common superclass