File f = new File(ds.getBasedir(), srcFiles[j]); filelist.append(" ").append('"').append(f.getAbsolutePath()).append('"'); if (filelist.length() > cmdLength) { execP4Add(filelist); filelist = new StringBuffer(); }
File f = new File(ds.getBasedir(), srcFiles[j]); filelist.append(" ").append('"').append(f.getAbsolutePath()).append('"'); doneFileNum++; if (filelist.length() > cmdLength) { execP4Fstat(filelist); filelist = new StringBuffer(); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/perforce/P4Add.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/perforce/P4Fstat.java
Method name: void execute() Method name: void execute()
Number of AST nodes: 5 Number of AST nodes: 6
1
File f = new File(ds.getBasedir(), srcFiles[j]);
1
File f = new File(ds.getBasedir(), srcFiles[j]);
2
                    filelist.append(" ").append('"').append(f.getAbsolutePath()).append('"');
2
                    filelist.append(" ").append('"').append(f.getAbsolutePath()).append('"');
3
                    doneFileNum++;
3
                    if (filelist.length() > cmdLength) {
4
                    if (filelist.length() > cmdLength) {
4
                        execP4Add(filelist);
5
                        execP4Fstat(filelist);
5
                        filelist = new StringBuffer();
6
                        filelist = new StringBuffer();
6
                    }
7
                    }
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 different classes having the same super class
Number of node comparisons15
  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 fragment1
    Time elapsed for statement mapping (ms)1.4
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    11
    File f = new File(ds.getBasedir(), srcFiles[j]);
    13
    File f = new File(ds.getBasedir(), srcFiles[j]);
    12
    filelist.append(" ").append('"').append(f.getAbsolutePath()).append('"');
    14
    filelist.append(" ").append('"').append(f.getAbsolutePath()).append('"');
                                        
    15
    doneFileNum++;
    13
    if (filelist.length() > cmdLength)
    16
    if (filelist.length() > cmdLength)
    14
    execP4Add(filelist);
    14
    execP4Add(filelist);
    17
    execP4Fstat(filelist);
    Differences
    Expression1Expression2Difference
    execP4AddexecP4FstatMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression execP4Add(filelist) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method execP4Add
    Expression execP4Fstat(filelist) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method execP4Fstat
    Expression execP4Add(filelist) is a void method call, and thus it cannot be parameterized
    Expression execP4Fstat(filelist) is a void method call, and thus it cannot be parameterized
    17
    execP4Fstat(filelist);
    15
    filelist = new StringBuffer();
    18
    filelist = new StringBuffer();
    Precondition Violations (5)
    Row Violation
    1Expression execP4Add(filelist) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression execP4Fstat(filelist) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression execP4Add(filelist) is a void method call, and thus it cannot be parameterized
    4Expression execP4Fstat(filelist) is a void method call, and thus it cannot be parameterized
    5Clone fragment #1 returns variables filelist , while Clone fragment #2 returns variables