String[] ret = new String[_propertyInfos.length]; for (int i = 0; i < _propertyInfos.length; i++) { ret[i] = _propertyInfos[i].getCompareString(); } return ret;
DetailAttribute[] ret = new DetailAttribute[attributes.length]; for (int i = 0; i < attributes.length; i++) { ret[i] = new DetailAttribute(attributes[i]); } return ret;
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/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/mapping/DetailAttribute.java
Method name: String[] getAttributeNames() Method name: DetailAttribute[] createDetailtAttributes(PropertyInfo[])
Number of AST nodes: 4 Number of AST nodes: 4
1
String[] ret = new String[_propertyInfos.length];
1
DetailAttribute[] ret = new DetailAttribute[attributes.length];
2
      for (int i = 0; i < _propertyInfos.length; i++)
2
      for (int i = 0; i < attributes.length; i++)
3
      {
3
      {
4
         ret[i] = _propertyInfos[i].getCompareString();
4
         ret[i] = new DetailAttribute(attributes[i]);
5
      }
5
      }
6
      return ret;
6
      return ret;
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 statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)1.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                    
    1
    DetailAttribute[] ret = new DetailAttribute[attributes.length];
    1
    String[] ret = new String[_propertyInfos.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 < attributes.length; i++)
    Differences
    Expression1Expression2Difference
    _propertyInfosattributesVARIABLE_NAME_MISMATCH
    2
    for (int i = 0; i < attributes.length; i++)
                                                                                              
    3
    ret[i] = new DetailAttribute(attributes[i]);
    Preondition Violations
    Unmatched statement ret[i]=new DetailAttribute(attributes[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3
    ret[i] = new DetailAttribute(attributes[i]);
    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;
    Preondition Violations
    Unmatched return ret;
    4
    return ret;
    4
    return ret;
    4
    return ret;
    Preondition Violations
    Unmatched return ret;
                                
    Precondition Violations (5)
    Row Violation
    1Unmatched statement ret[i]=new DetailAttribute(attributes[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched 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
    3Unmatched return ret;
    4Unmatched return ret;
    5The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero