package org.apache.tools.ant.types.resources.comparators; import org.apache.tools.ant.types.Resource; /** * Compares Resources by last modification date. * @since Ant 1.7 */ public class Date 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) { return (int) (foo.getLastModified() - bar.getLastModified()); }
package org.apache.tools.ant.types.resources.comparators; import org.apache.tools.ant.types.Resource; /** * Compares Resources by size. * @since Ant 1.7 */ public class Size 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) { return (int) (foo.getSize() - bar.getSize()); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/resources/comparators/Date.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/resources/comparators/Size.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
package org.apache.tools.ant.types.resources.comparators;
1
package org.apache.tools.ant.types.resources.comparators;
2
import org.apache.tools.ant.types.Resource;
2
import org.apache.tools.ant.types.Resource;
3
/**
3
/**
4
 * Compares Resources by last modification date.
4
 * Compares Resources by size.
5
 * @since Ant 1.7
5
 * @since Ant 1.7
6
 */
6
 */
7
public class Date extends ResourceComparator {
7
public class Size extends ResourceComparator {
8
    /**
8
    /**
9
     * Compare two Resources.
9
     * Compare two Resources.
10
     * @param foo the first Resource.
10
     * @param foo the first Resource.
11
     * @param bar the second Resource.
11
     * @param bar the second Resource.
12
     * @return a negative integer, zero, or a positive integer as the first
12
     * @return a negative integer, zero, or a positive integer as the first
13
     *         argument is less than, equal to, or greater than the second.
13
     *         argument is less than, equal to, or greater than the second.
14
     */
14
     */
15
    protected int resourceCompare(Resource foo, Resource bar) {
15
    protected int resourceCompare(Resource foo, Resource bar) {
16
        return (int) (foo.getLastModified() - bar.getLastModified());
16
        return (int) (foo.getSize() - bar.getSize());
17
    }
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.0
Clones location
Number of node comparisons0