if (util.match("/^... clientFile (.+)$/", line)) { String f = util.group(1); existing.add(f); } else if (util.match("/^(.+) - no such file/", line)) { String f = util.group(1); nonExisting.add(f); }
if (propertyValue.indexOf("FILE.") == 0) { // The property is the name of a file. We are testing // a location attribute, so we need to resolve the given // file name in the provided folder. String fileName = propertyValue.substring(5, propertyValue.length()); File f = new File(workingDir, fileName); propertyValue = f.getAbsolutePath(); } assertEquals(assertMsg, propertyValue, xmlValue);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/perforce/FStatP4OutputHandler.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/XmlPropertyTest.java
Method name: void process(String) Method name: void ensureProperties(String, File, File, Project, Properties)
Number of AST nodes: 6 Number of AST nodes: 5
1
if (util.match("/^... clientFile (.+)$/", line)) {
1
if (
2
            String f = util.group(1);
3
            existing.add(f);
4
        } else if (util.match("/^(.+) - no such file/", line)) {
2
propertyValue.indexOf("FILE.") == 0) {
3
                    // The property is the name of a file.  We are testing
4
                    // a location attribute, so we need to resolve the given
5
                    // file name in the provided folder.
5
            String f = util.group(1);
6
                    String f
6
            nonExisting.add(f
7
ileName =
8
                        propertyValue.substring(5, propertyValue.length());
9
                    File f = new File(workingDir, fileName);
7
);
10
                    propertyValue = f.getAbsolutePath();
8
        }
11
                }
12
                assertEquals(assertMsg, propertyValue, xmlValue);
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in different classes
Number of node comparisons2