for (int i = 0; i < values.length; i++) { if (i != 0) { sb.append(" | "); } sb.append(values[i]); } sb.append(") ");
for (int i = 0; i < RMIC_CLASSNAMES.length; i++) { if (i != 0) { buf.append(", "); } buf.append(RMIC_CLASSNAMES[i]); } buf.append(" have been found. A common solution is to set the" + " environment variable JAVA_HOME or CLASSPATH.");
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/rmic/KaffeRmic.java
Method name: void printElementDecl(PrintWriter, Project, String, Class) Method name: boolean execute()
Number of AST nodes: 5 Number of AST nodes: 5
1
for (int i = 0; i < values.length; i++) {
1
for (int i = 0; i < RMIC_CLASSNAMES.length; i++) {
2
                                if (i != 0) {
2
                if (i != 0) {
3
                                    sb.append(" | ");
3
                    buf.append(", ");
4
                                }
4
                
5
           
5
}
6
                     sb.append(values[i]);
6
                buf.append(RMIC_CLASSNAMES[i]);
7
            
7
            }
8
                }
8
            
9
                            sb.append(") 
9
buf.append(" have been found. A common solution is to set the"
10
");
10
                       + " environment variable JAVA_HOME or CLASSPATH.");
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.3
Clones locationClones are in different classes
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    59
    for (int i = 0; i < values.length; i++)
    59
    for (int i = 0; i < values.length; i++)
    6
    for (int i = 0; i < RMIC_CLASSNAMES.length; i++)
    Differences
    Expression1Expression2Difference
    valuesRMIC_CLASSNAMESVARIABLE_NAME_MISMATCH
    6
    for (int i = 0; i < RMIC_CLASSNAMES.length; i++)
    60
    if (i != 0)
    7
    if (i != 0)
    61
    sb.append(" | ");
    61
    sb.append(" | ");
    8
    buf.append(", ");
    Differences
    Expression1Expression2Difference
    " | "", "LITERAL_VALUE_MISMATCH
    sbbufVARIABLE_NAME_MISMATCH
    8
    buf.append(", ");
    62
    sb.append(values[i]);
    62
    sb.append(values[i]);
    9
    buf.append(RMIC_CLASSNAMES[i]);
    Differences
    Expression1Expression2Difference
    valuesRMIC_CLASSNAMESVARIABLE_NAME_MISMATCH
    sbbufVARIABLE_NAME_MISMATCH
    9
    buf.append(RMIC_CLASSNAMES[i]);
    63
    sb.append(") ");
    63
    sb.append(") ");
    10
    buf.append(" have been found. A common solution is to set the" + " environment variable JAVA_HOME or CLASSPATH.");
    Differences
    Expression1Expression2Difference
    ") "" have been found. A common solution is to set the" + " environment variable JAVA_HOME or CLASSPATH."TYPE_COMPATIBLE_REPLACEMENT
    sbbufVARIABLE_NAME_MISMATCH
    10
    buf.append(" have been found. A common solution is to set the" + " environment variable JAVA_HOME or CLASSPATH.");
    Precondition Violations (1)
    Row Violation
    1The refactoring of the clones is infeasible, because classes org.apache.tools.ant.taskdefs.AntStructure.DTDPrinter and org.apache.tools.ant.taskdefs.rmic.KaffeRmic do not have a common superclass