StringBuffer expected = new StringBuffer(); for (int i=0; i<filenames.length; i++) { String ch = "F"; if (files[i].isDirectory()) ch = "T"; // f2name shouldn't be selected: only timestamp has changed! if (filenames[i].equalsIgnoreCase(f3name)) ch = "T"; if (filenames[i].equalsIgnoreCase(f4name)) ch = "T"; expected.append(ch); }
StringBuffer expected = new StringBuffer(); for (int i=0; i<filenames.length; i++) { String ch = "F"; if (files[i].isDirectory()) ch = "T"; if (filenames[i].equalsIgnoreCase(f3name)) ch = "T"; if (filenames[i].equalsIgnoreCase(f4name)) ch = "T"; expected.append(ch); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java
Method name: void testScenario1() Method name: void _testScenario2()
Number of AST nodes: 10 Number of AST nodes: 10
1
StringBuffer expected = new StringBuffer();
1
StringBuffer expected = new StringBuffer();
2
            for (int i=0; i<filenames.length; i++) {
2
            for (int i=0; i<filenames.length; i++) {
3
                String ch = "F";
3
                String ch = "F";
4
                if (files[i].isDirectory()) ch = "T";
4
                if (files[i].isDirectory()) ch = "T";
5
                // f2name shouldn't be selected: only timestamp has changed!
6
                if (filenames[i].equalsIgnoreCase(f3name)) ch = "T";
5
                if (filenames[i].equalsIgnoreCase(f3name)) ch = "T";
7
                if (filenames[i].equalsIgnoreCase(f4name)) ch = "T";
6
                if (filenames[i].equalsIgnoreCase(f4name)) ch = "T";
8
                expected.append(ch);
7
                expected.append(ch);
9
            }
8
            }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)1.4
Clones locationClones are declared in the same class
Number of node comparisons32
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)11.2
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    18
    StringBuffer expected = new StringBuffer();
    23
    StringBuffer expected = new StringBuffer();
    19
    for (int i = 0; i < filenames.length; i++)
    24
    for (int i = 0; i < filenames.length; i++)
    20
    String ch = "F";
    25
    String ch = "F";
    21
    if (files[i].isDirectory())
    26
    if (files[i].isDirectory())
    22
    ch = "T";
    27
    ch = "T";
    23
    if (filenames[i].equalsIgnoreCase(f3name))
    28
    if (filenames[i].equalsIgnoreCase(f3name))
    24
    ch = "T";
    29
    ch = "T";
    25
    if (filenames[i].equalsIgnoreCase(f4name))
    30
    if (filenames[i].equalsIgnoreCase(f4name))
    26
    ch = "T";
    31
    ch = "T";
    27
    expected.append(ch);
    32
    expected.append(ch);
    Precondition Violations (0)
    Row Violation