String[] sP = getSourcespath().list(); for (int i = 0; i < sP.length; i++) { File f = new File(sP[i]); // not necessary as JDepend would fail, but why loose // some time? if (!f.exists() || !f.isDirectory()) { throw new BuildException("\"" + f.getPath() + "\" does not represent a valid" + " directory. JDepend would" + " fail."); } commandline.createArgument().setValue(f.getPath()); }
if (getClassespath() != null) { // This is the new way - use classespath - code is the // same for now String[] cP = getClassespath().list(); for (int i = 0; i < cP.length; i++) { File f = new File(cP[i]); // not necessary as JDepend would fail, but why loose // some time? if (!f.exists()) { throw new BuildException("\"" + f.getPath() + "\" does not represent a valid" + " file or directory. JDepend would" + " fail."); } commandline.createArgument().setValue(f.getPath()); } }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java
Method name: int executeAsForked(CommandlineJava, ExecuteWatchdog) Method name: int executeAsForked(CommandlineJava, ExecuteWatchdog)
Number of AST nodes: 6 Number of AST nodes: 7
1
if (getClassespath() != null) {
2
            // This is the new way - use classespath - code is the
3
            // same for now
1
String[] sP = getSourcespath().list();
4
            String[] cP = getClassespath().list();
2
            for (int i = 0; i < sP.length; i++) {
5
            for (int i = 0; i < cP.length; i++) {
3
                File f = new File(sP[i]);
6
                File f = new File(cP[i]);
4
                // not necessary as JDepend would fail, but why loose
7
                // not necessary as JDepend would fail, but why loose
5
                // some time?
8
                // some time?
6
                if (!f.exists() || !f.isDirectory()) {
9
                if (!f.exists()) {
7
                    throw new BuildException("\"" + f.getPath()
10
                    throw new BuildException("\"" + f.getPath()
8
                                             + "\" does not represent a valid"
11
                                             + "\" does not represent a valid"
9
                                             + " directory. JDepend would"
12
                                             + " file or directory. JDepend would"
10
                                             + " fail.");
13
                                             + " fail.");
11
                }
14
                }
12
                commandline.createArgument().setValue(f.getPath());
15
                commandline.createArgument().setValue(f.getPath());
13
            }
16
            }
17
        }
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 the same method
Number of node comparisons1