File[] newCompileList = new File[compileList.length + newFiles.length]; System.arraycopy(compileList, 0, newCompileList, 0, compileList.length); System.arraycopy(newFiles, 0, newCompileList, compileList.length, newFiles.length);
String[] files = new String [directories.length + filesPerSe.length]; System.arraycopy(directories, 0, files, 0, directories.length); System.arraycopy(filesPerSe, 0, files, directories.length, filesPerSe.length);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Javac.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Tar.java
Method name: void scanDir(File, File, String[]) Method name: String[] getFileNames(FileSet)
Number of AST nodes: 3 Number of AST nodes: 3
1
File[] newCompileList
2
                = new File[compileList.length + newFiles.length];
1
String[] files = new String [directories.length + filesPerSe.length];
3
            System.arraycopy(compileList, 0, newCompileList, 0,
2
        System.arraycopy(
4
                    compileList.length);
3
directories, 0, files, 0, directories.length);
5
            System.arraycopy(newFiles, 0, newCompileList,
4
        System.arraycopy(filesPerSe, 0, files, directories.length,
6
                    compileList.length, newFiles.length);
5
                         filesPerSe.length);
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.0
Clones locationClones are in different classes having the same super class
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                              
    4
    String[] files = new String[directories.length + filesPerSe.length];
    7
    File[] newCompileList = new File[compileList.length + newFiles.length];
                                                                                                                                                    
    8
    System.arraycopy(compileList, 0, newCompileList, 0, compileList.length);
    8
    System.arraycopy(compileList, 0, newCompileList, 0, compileList.length);
    5
    System.arraycopy(directories, 0, files, 0, directories.length);
    Differences
    Expression1Expression2Difference
    compileListdirectoriesVARIABLE_NAME_MISMATCH
    java.io.File[]java.lang.String[]VARIABLE_TYPE_MISMATCH
    newCompileListfilesVARIABLE_NAME_MISMATCH
    java.io.File[]java.lang.String[]VARIABLE_TYPE_MISMATCH
    compileListdirectoriesVARIABLE_NAME_MISMATCH
    java.io.File[]java.lang.String[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.io.File[] of variable compileList does not match with type java.lang.String[] of variable directories
    • Make classes java.io.File[] and java.lang.String[] extend a common superclass
    Type java.io.File[] of variable newCompileList does not match with type java.lang.String[] of variable files
    • Make classes java.io.File[] and java.lang.String[] extend a common superclass
    Type int of variable compileList.length does not match with type int of variable directories.length
    • Make classes java.io.File[] and java.lang.String[] extend a common superclass
    5
    System.arraycopy(directories, 0, files, 0, directories.length);
    9
    System.arraycopy(newFiles, 0, newCompileList, compileList.length, newFiles.length);
    9
    System.arraycopy(newFiles, 0, newCompileList, compileList.length, newFiles.length);
    6
    System.arraycopy(filesPerSe, 0, files, directories.length, filesPerSe.length);
    Differences
    Expression1Expression2Difference
    newFilesfilesPerSeVARIABLE_NAME_MISMATCH
    java.io.File[]java.lang.String[]VARIABLE_TYPE_MISMATCH
    newCompileListfilesVARIABLE_NAME_MISMATCH
    java.io.File[]java.lang.String[]VARIABLE_TYPE_MISMATCH
    compileListdirectoriesVARIABLE_NAME_MISMATCH
    java.io.File[]java.lang.String[]VARIABLE_TYPE_MISMATCH
    newFilesfilesPerSeVARIABLE_NAME_MISMATCH
    java.io.File[]java.lang.String[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.io.File[] of variable newFiles does not match with type java.lang.String[] of variable filesPerSe
    • Make classes java.io.File[] and java.lang.String[] extend a common superclass
    Type java.io.File[] of variable newCompileList does not match with type java.lang.String[] of variable files
    • Make classes java.io.File[] and java.lang.String[] extend a common superclass
    Type int of variable compileList.length does not match with type int of variable directories.length
    • Make classes java.io.File[] and java.lang.String[] extend a common superclass
    Type int of variable newFiles.length does not match with type int of variable filesPerSe.length
    • Make classes java.io.File[] and java.lang.String[] extend a common superclass
    6
    System.arraycopy(filesPerSe, 0, files, directories.length, filesPerSe.length);
    Precondition Violations (7)
    Row Violation
    1Type java.io.File[] of variable compileList does not match with type java.lang.String[] of variable directories
    2Type java.io.File[] of variable newCompileList does not match with type java.lang.String[] of variable files
    3Type int of variable compileList.length does not match with type int of variable directories.length
    4Type java.io.File[] of variable newFiles does not match with type java.lang.String[] of variable filesPerSe
    5Type java.io.File[] of variable newCompileList does not match with type java.lang.String[] of variable files
    6Type int of variable compileList.length does not match with type int of variable directories.length
    7Type int of variable newFiles.length does not match with type int of variable filesPerSe.length