for (int i = 0; i < count; i++) { if (i != 0) { sb.append(" | "); } sb.append(v.elementAt(i)); }
for (int i = 0; i < values.length; i++) { if (i != 0) { sb.append(" | "); } sb.append(values[i]); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/AntStructure.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/AntStructure.java
Method name: void printElementDecl(PrintWriter, Project, String, Class) Method name: void printElementDecl(PrintWriter, Project, String, Class)
Number of AST nodes: 4 Number of AST nodes: 4
1
for (int i = 0; i < count; i++) {
1
for (int i = 0; i < 
2
values.length; i++) {
2
                    if (i != 0) {
3
                                if (i != 0) {
3
                        sb.append(" | ");
4
                                    sb.append(" | ");
4
                    }
5
                            
6
    }
5
                    sb.append(v.elementAt(i));
7
                                sb.append(v
8
alues[i]);
6
                }
9
                            }
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 the same method
Number of node comparisons9
  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)0.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    29
    for (int i = 0; i < count; i++)
    29
    for (int i = 0; i < count; i++)
    59
    for (int i = 0; i < values.length; i++)
    Differences
    Expression1Expression2Difference
    countvalues.lengthTYPE_COMPATIBLE_REPLACEMENT
    59
    for (int i = 0; i < values.length; i++)
    30
    if (i != 0)
    60
    if (i != 0)
    31
    sb.append(" | ");
    61
    sb.append(" | ");
    32
    sb.append(v.elementAt(i));
    32
    sb.append(v.elementAt(i));
    Preondition Violations
    Unmatched statement sb.append(v.elementAt(i)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                
                                                      
    62
    sb.append(values[i]);
    Preondition Violations
    Unmatched statement sb.append(values[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    62
    sb.append(values[i]);
    Precondition Violations (2)
    Row Violation
    1Unmatched statement sb.append(v.elementAt(i)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement sb.append(values[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted