if (c.eval()) { log("Condition true; setting " + property + " to " + value, Project.MSG_DEBUG); getProject().setNewProperty(property, value); } else if (alternative != null) { log("Condition false; setting " + property + " to " + alternative, Project.MSG_DEBUG); getProject().setNewProperty(property, alternative); } else { log("Condition false; not setting " + property, Project.MSG_DEBUG); }
if (ClassLoader.getSystemResource(location) != null) { log("Found resource: " + location); resourceDtds.put(publicID, location); } else { File dtdFile = new File(location); if (dtdFile.exists() && dtdFile.isFile()) { log("Found file: " + location); fileDtds.put(publicID, location); } }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/ConditionTask.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbc.java
Method name: void execute() Method name: void registerDTD(String, String)
Number of AST nodes: 7 Number of AST nodes: 7
1
if (c.eval()) {
1
if (ClassLoader.getSystemResource(location) != null) {
2
            log("Condition true; setting " + property + " to " + value,
2
                log("
3
                Project.MSG_DEBUG);
4
            getProject().setNewProperty(property, value);
5
        } else if (alternativ
3
Found resource: " + location);
4
                resourceDtds.put(publicID, location);
5
            } else {
6
e != null) {
6
                File dtdFile = n
7
            log("Condition false; setting " + property + " to " + alternative,
8
                Project.MSG_DEBUG);
9
            getProject().setNewProperty(property, altern
7
ew File(location);
8
                if (dtdFile.exists() && dtdFile.isFile()) {
10
ative);
9
                    log("Found file: " + location);
11
        } else {
10
        
12
            log("Condition false; not setting " + property,
11
            
12
fileDtds.put(publicID, location);
13
            
13
                }
14
    Project.MSG_DEBUG);
14
    
15
        }
15
        }
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.2
Clones locationClones are in different classes
Number of node comparisons2