public class Exists extends ResourceComparator { /** * Compare two Resources. * @param foo the first Resource. * @param bar the second Resource. * @return a negative integer, zero, or a positive integer as the first * argument is less than, equal to, or greater than the second. */ protected int resourceCompare(Resource foo, Resource bar) { boolean f = foo.isExists(); if (f == bar.isExists()) { return 0; } return f ? 1 : -1;
public class Type extends ResourceComparator { /** * Compare two Resources. * @param foo the first Resource. * @param bar the second Resource. * @return a negative integer, zero, or a positive integer as the first * argument is less than, equal to, or greater than the second. */ protected int resourceCompare(Resource foo, Resource bar) { boolean f = foo.isDirectory(); if (f == bar.isDirectory()) { return 0; } return f ? 1 : -1;
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/resources/comparators/Exists.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/resources/comparators/Type.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class Exists extends ResourceComparator {
1
public class Type extends ResourceComparator {
2
    /**
2
    /**
3
     * Compare two Resources.
3
     * Compare two Resources.
4
     * @param foo the first Resource.
4
     * @param foo the first Resource.
5
     * @param bar the second Resource.
5
     * @param bar the second Resource.
6
     * @return a negative integer, zero, or a positive integer as the first
6
     * @return a negative integer, zero, or a positive integer as the first
7
     *         argument is less than, equal to, or greater than the second.
7
     *         argument is less than, equal to, or greater than the second.
8
     */
8
     */
9
    protected int resourceCompare(Resource foo, Resource bar) {
9
    protected int resourceCompare(Resource foo, Resource bar) {
10
        boolean f = foo.isExists();
10
        boolean f = foo.isDirectory();
11
        if (f == bar.isExists()) {
11
        if (f == bar.isDirectory()) {
12
            return 0;
12
            return 0;
13
        }
13
        }
14
        return f ? 1 : -1;
14
        return f ? 1 : -1;
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.0
Clones location
Number of node comparisons0