protected void addClasspathEntry(String resource) { /* * pre Ant 1.6 this method used to call getClass().getResource * while Ant 1.6 will call ClassLoader.getResource(). * * The difference is that Class.getResource expects a leading * slash for "absolute" resources and will strip it before * delegating to ClassLoader.getResource - so we now have to * emulate Class's behavior. */ if (resource.startsWith("/")) { resource = resource.substring(1); } else { resource = "org/apache/tools/ant/taskdefs/optional/" + resource; } File f = LoaderUtils.getResourceSource(getClass().getClassLoader(), resource); if (f != null) { log("Found " + f.getAbsolutePath(), Project.MSG_DEBUG); createClasspath().setLocation(f); } else { log("Couldn\'t find " + resource, Project.MSG_VERBOSE);
private void addClasspathEntry(String resource) { /* * pre Ant 1.6 this method used to call getClass().getResource * while Ant 1.6 will call ClassLoader.getResource(). * * The difference is that Class.getResource expects a leading * slash for "absolute" resources and will strip it before * delegating to ClassLoader.getResource - so we now have to * emulate Class's behavior. */ if (resource.startsWith("/")) { resource = resource.substring(1); } else { resource = "org/apache/tools/ant/taskdefs/optional/jdepend/" + resource; } File f = LoaderUtils.getResourceSource(getClass().getClassLoader(), resource); if (f != null) { log("Found " + f.getAbsolutePath(), Project.MSG_DEBUG); runtimeClasses.createPath().setLocation(f); } else { log("Couldn\'t find " + resource, Project.MSG_DEBUG);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ANTLR.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
protected void addClasspathEntry(String resource) {
1
private void addClasspathEntry(String resource) {
2
        /*
2
        /*
3
         * pre Ant 1.6 this method used to call getClass().getResource
3
         * pre Ant 1.6 this method used to call getClass().getResource
4
         * while Ant 1.6 will call ClassLoader.getResource().
4
         * while Ant 1.6 will call ClassLoader.getResource().
5
         *
5
         *
6
         * The difference is that Class.getResource expects a leading
6
         * The difference is that Class.getResource expects a leading
7
         * slash for "absolute" resources and will strip it before
7
         * slash for "absolute" resources and will strip it before
8
         * delegating to ClassLoader.getResource - so we now have to
8
         * delegating to ClassLoader.getResource - so we now have to
9
         * emulate Class's behavior.
9
         * emulate Class's behavior.
10
         */
10
         */
11
        if (resource.startsWith("/")) {
11
        if (resource.startsWith("/")) {
12
            resource = resource.substring(1);
12
            resource = resource.substring(1);
13
        } else {
13
        } else {
14
            resource = "org/apache/tools/ant/taskdefs/optional/"
14
            resource = "org/apache/tools/ant/taskdefs/optional/jdepend/"
15
                + resource;
15
                + resource;
16
        }
16
        }
17
        File f = LoaderUtils.getResourceSource(getClass().getClassLoader(),
17
        File f = LoaderUtils.getResourceSource(getClass().getClassLoader(),
18
                                               resource);
18
                                               resource);
19
        if (f != null) {
19
        if (f != null) {
20
            log("Found " + f.getAbsolutePath(), Project.MSG_DEBUG);
20
            log("Found " + f.getAbsolutePath(), Project.MSG_DEBUG);
21
            createClasspath().setLocation(f);
21
            runtimeClasses.createPath().setLocation(f);
22
        } else {
22
        } else {
23
            log("Couldn\'t find " + resource, Project.MSG_VERBOSE);
23
            log("Couldn\'t find " + resource, Project.MSG_DEBUG);
24
        
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.0
Clones location
Number of node comparisons0