List valueList = getValues(); int size = valueList.size(); Object[] result = new Object[size+1]; for (int i=0; i<size; i++) result[i+1] = valueList.get(i); return result;
List typeList = getTypes(); int size = typeList.size(); Type[] result = new Type[size+1]; for (int i=0; i<size; i++) result[i+1] = (Type) typeList.get(i); return result;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/impl/CollectionFilterImpl.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/impl/CollectionFilterImpl.java
Method name: Object[] valueArray() Method name: Type[] typeArray()
Number of AST nodes: 6 Number of AST nodes: 6
1
List valueList = getValues();
1
List typeList = getTypes();
2
		int size = valueList.size();
2
		int size = typeList.size();
3
		Object[] result = new Object[size+1];
3
		Type[] result = new Type[size+1];
4
		for (int i=0; i<size; i++) result[i+1] = valueList.get(i);
4
		for (int i=0; i<size; i++) result[i+1] = (Type) typeList.get(i);
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.1
Clones locationClones are declared in the same class
Number of node comparisons20
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    List valueList = getValues();
    1
    List valueList = getValues();
    1
    List typeList = getTypes();
    Differences
    Expression1Expression2Difference
    valueListtypeListVARIABLE_NAME_MISMATCH
    getValuesgetTypesMETHOD_INVOCATION_NAME_MISMATCH
    1
    List typeList = getTypes();
    2
    int size = valueList.size();
    2
    int size = valueList.size();
    2
    int size = typeList.size();
    Differences
    Expression1Expression2Difference
    valueListtypeListVARIABLE_NAME_MISMATCH
    2
    int size = typeList.size();
                                                                            
    3
    Type[] result = new Type[size + 1];
    3
    Object[] result = new Object[size + 1];
                                                                                    
    4
    for (int i = 0; i < size; i++)
    4
    for (int i = 0; i < size; i++)
                                                                                  
    5
    result[i + 1] = (Type)typeList.get(i);
    Preondition Violations
    Unmatched statement result[i + 1]=(Type)typeList.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    result[i + 1] = (Type)typeList.get(i);
    5
    result[i + 1] = valueList.get(i);
    5
    result[i + 1] = valueList.get(i);
    Preondition Violations
    Unmatched statement result[i + 1]=valueList.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                        
                                      
    6
    return result;
    Preondition Violations
    Unmatched return result;
    6
    return result;
    6
    return result;
    6
    return result;
    Preondition Violations
    Unmatched return result;
                                      
    Precondition Violations (5)
    Row Violation
    1Unmatched statement result[i + 1]=(Type)typeList.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement result[i + 1]=valueList.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched return result;
    4Unmatched return result;
    5Clone fragment #1 returns variables size, valueList, i , while Clone fragment #2 returns variables size, typeList, i