for (Iterator i = filesList.iterator(); i.hasNext();) { File f = (File) i.next(); File newFile = new File(destDir, f.getName()); if (newFile.exists()) { filesToRemove.add(f); } }
String key = (String) i.next(); Object value = getBeans().get(key); if (value != null) { m.declareBean(key, value, value.getClass()); } else { // BSF uses a hashtable to store values // so cannot declareBean with a null value // So need to remove any bean of this name as // that bean should not be visible m.undeclareBean(key); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/image/Image.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/optional/ScriptRunner.java
Method name: void execute() Method name: void declareBeans(BSFManager)
Number of AST nodes: 5 Number of AST nodes: 5
1
for (Iterator i = filesList.iterator(); i.hasNext();) {
1
String key = (String) i.next();
2
                    File f = (File) i.next();
2
            
3
                    File newFile = new File(destDir, f.getName
3
Object value = getBeans().get(key);
4
            if (value != null) {
4
());
5
                m.declareBean(key, value, value.getClass());
5
                    if (newFile.exists()) {
6
            
6
                        filesToRemove.add(f);
7
                    }
8
    
7
} else {
8
                // BSF uses a hashtable to store values
9
                // so cannot declareBean with a null value
10
                // So need to remove any bean of this name as
11
                // that bean should not be visible
12
                m.undeclareBean(key);
9
            }
13
            }
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 comparisons1