try { // Should be safe to parse ProjectHelper2 parser = new ProjectHelper2(); UnknownElement ue = parser.parseUnknownElement(project, antlibUrl); // Check name is "antlib" if (!(ue.getTag().equals(TAG))) { throw new BuildException( "Unexpected tag " + ue.getTag() + " expecting " + TAG, ue.getLocation()); } Antlib antlib = new Antlib(); antlib.setProject(project); antlib.setLocation(ue.getLocation()); antlib.setTaskName("antlib"); antlib.init(); ue.configure(antlib); return antlib; } finally { helper.exitAntLib(); }
try { Project project = getTask().getProject(); gentask = (BorlandGenerateClient) project.createTask("internal_bas_generateclient"); gentask.setEjbjar(sourceJar); gentask.setDebug(java2iiopdebug); Path classpath = getCombinedClasspath(); if (classpath != null) { gentask.setClasspath(classpath); } gentask.setVersion(version); gentask.setTaskName("generate client"); gentask.execute(); } catch (Exception e) { //TO DO : delete the file if it is not a valid file. String msg = "Exception while calling " + VERIFY + " Details: " + e.toString(); throw new BuildException(msg, e); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Antlib.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java
Method name: Antlib createAntlib(Project, URL, String) Method name: void generateClient(File)
Number of AST nodes: 12 Number of AST nodes: 11
1
try {
1
try {
2
            // Should be safe to parse
2
            
3
            ProjectHelper2 parser = new ProjectHelper2();
4
            UnknownElement ue =
5
                parser.parseUnknownElem
3
Project project = getTask().getProject();
4
            gentask
6
ent(project, antlibUrl);
5
                = (BorlandGenerateClient) project
7
            // Check name is "antlib"
6
.createTask("internal_bas_generateclient");
7
            gentask.setEjbjar(sourceJar);
8
            if (!(ue.getTag().equals(TAG))) {
8
            
9
                throw new BuildException(
10
                    "Unexpected tag " + ue.getTag() + " expecting "
11
                    + TAG, ue.getLocation()
9
gentask.setDebug(java2iiopdebug);
10
            Path classpath = getCombinedClasspath();
11
            if (classpath != null) {
12
);
12
                gentask.setClasspath(classpath);
13
            }
13
            }
14
            Antlib antlib = new Antlib();
14
            
15
            antlib.setProject(project);
16
            antlib.setLocation(ue.getLocation
15
gentask.setVersion(version);
16
            gentask.setTaskName("generate client");
17
());
17
            gentask.execute();
18
            antlib.setTaskName("antlib");
18
        
19
            antlib.init();
20
            ue.configure(antlib);
21
            return antlib;
22
        } finally {
23
            helper.exitAntLib(
19
} catch (Exception e) {
20
            //TO DO : delete the file if it is not a valid file.
21
            String msg = "Exception while calling " + VERIFY + " Details: "
22
                + e.toString();
24
);
23
            throw new BuildException(msg, e);
25
        }
24
        }
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