String[] result = new String[length]; for ( int i=0; i<length; i++ ) { result[i] = strings[begin+i]; } return result;
Object[] result = new Object[length]; for ( int i=0; i<length; i++ ) { result[i] = objects[begin+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/util/ArrayHelper.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/util/ArrayHelper.java
Method name: String[] slice(String[], int, int) Method name: Object[] slice(Object[], int, int)
Number of AST nodes: 4 Number of AST nodes: 4
1
String[] result = new String[length];
1
Object[] result = new Object[length];
2
		for ( int i=0; i<length; i++ ) {
2
		for ( int i=0; i<length; i++ ) {
3
			result[i] = strings[begin+i];
3
			result[i] = objects[begin+i];
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.1
Clones locationClones are declared in the same class
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
    Object[] result = new Object[length];
    1
    String[] result = new String[length];
                                                                                
    2
    for (int i = 0; i < length; i++)
    2
    for (int i = 0; i < length; i++)
                                                                    
    3
    result[i] = objects[begin + i];
    Preondition Violations
    Unmatched statement result[i]=objects[begin + i]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3
    result[i] = objects[begin + i];
    3
    result[i] = strings[begin + i];
    3
    result[i] = strings[begin + i];
    Preondition Violations
    Unmatched statement result[i]=strings[begin + i]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                    
                                      
    4
    return result;
    Preondition Violations
    Unmatched return result;
    4
    return result;
    4
    return result;
    4
    return result;
    Preondition Violations
    Unmatched return result;
                                      
    Precondition Violations (5)
    Row Violation
    1Unmatched statement result[i]=objects[begin + 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]=strings[begin + 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;
    5The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero