String filename = line.substring(0, index); String rev = null; int indexrev = -1; if ((indexrev = line.indexOf(REVISION, index)) != -1) { rev = line.substring(indexrev + REVISION.length()); } entry = new CvsTagEntry(filename, rev); entries.addElement(entry); log(entry.toString(), Project.MSG_VERBOSE);
if ((index = line.indexOf(FILE_WAS_REMOVED)) != -1) { // it is a removed file String filename = line.substring(0, index); String rev = null; int indexrev = -1; if ((indexrev = line.indexOf(REVISION, index)) != -1) { rev = line.substring(indexrev + REVISION.length()); } entry = new CvsTagEntry(filename, null, rev); entries.addElement(entry); log(entry.toString(), Project.MSG_VERBOSE); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/cvslib/CvsTagDiff.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/cvslib/CvsTagDiff.java
Method name: CvsTagEntry[] parseRDiff(File) Method name: CvsTagEntry[] parseRDiff(File)
Number of AST nodes: 8 Number of AST nodes: 9
1
if ((index = line.indexOf(FILE_WAS_REMOVED)) != -1) {
2
                        // it is a removed file
1
String filename = line.substring(0, index);
3
                        String filename = line.substring(0, index);
2
                        String rev = null;
4
                        String rev = null;
3
                        int indexrev = -1;
5
                        int indexrev = -1;
4
                        if ((indexrev = line.indexOf(REVISION, index)) != -1) {
6
                        if ((indexrev = line.indexOf(REVISION, index)) != -1) {
5
                            rev = line.substring(indexrev + REVISION.length());
7
                            rev = line.substring(indexrev + REVISION.length());
6
                        }
8
                        }
7
                        entry = new CvsTagEntry(filename, rev);
9
                        entry = new CvsTagEntry(filename, null, rev);
8
                        entries.addElement(entry);
10
                        entries.addElement(entry);
9
                        log(entry.toString(), Project.MSG_VERBOSE);
11
                        log(entry.toString(), Project.MSG_VERBOSE);
12
                    }
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.5
Clones locationClones are in the same method
Number of node comparisons42
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)4.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    16
    String filename = line.substring(0, index);
    33
    String filename = line.substring(0, index);
    17
    String rev = null;
    34
    String rev = null;
    18
    int indexrev = -1;
    35
    int indexrev = -1;
    19
    if ((indexrev = line.indexOf(REVISION, index)) != -1)
    36
    if ((indexrev = line.indexOf(REVISION, index)) != -1)
    20
    rev = line.substring(indexrev + REVISION.length());
    37
    rev = line.substring(indexrev + REVISION.length());
    21
    entry = new CvsTagEntry(filename, rev);
    21
    entry = new CvsTagEntry(filename, rev);
    38
    entry = new CvsTagEntry(filename, null, rev);
    Differences
    Expression1Expression2Difference
    new CvsTagEntry(filename,rev)new CvsTagEntry(filename,null,rev)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression new CvsTagEntry(filename,rev) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new CvsTagEntry(filename,null,rev) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    38
    entry = new CvsTagEntry(filename, null, rev);
    22
    entries.addElement(entry);
    39
    entries.addElement(entry);
    23
    log(entry.toString(), Project.MSG_VERBOSE);
    40
    log(entry.toString(), Project.MSG_VERBOSE);
    Precondition Violations (2)
    Row Violation
    1Expression new CvsTagEntry(filename,rev) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new CvsTagEntry(filename,null,rev) cannot be parameterized, because it has dependencies to/from statements that will be extracted