void verifySettings() { if (userProvidedExpression == null) { setError("The expression attribute is required"); } } /** * Tests a regular expression against each line of text in the file. * * @param basedir the base directory the scan is being done from * @param filename is the name of the file to check * @param file is a java.io.File object the selector can use * @return whether the file should be selected or not */ public boolean isSelected(File basedir, String filename, File file) { return isSelected(new FileResource(file));
void verifySettings() { if (contains == null) { setError("The text attribute is required"); } } /** * The heart of the matter. This is where the selector gets to decide * on the inclusion of a file in a particular fileset. * * @param basedir the base directory the scan is being done from * @param filename is the name of the file to check * @param file is a java.io.File object the selector can use * @return whether the file should be selected or not */ public boolean isSelected(File basedir, String filename, File file) { return isSelected(new FileResource(file));
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/ContainsRegexpSelector.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/ContainsSelector.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
void verifySettings() {
1
void verifySettings() {
2
        if (userProvidedExpression == null) {
2
        if (contains == null) {
3
            setError("The expression attribute is required");
3
            setError("The text attribute is required");
4
        }
4
        }
5
    }
5
    }
6
    /**
6
    /**
7
     * Tests a regular expression against each line of text in the
7
     * The heart of the matter. This is where the selector gets to decide
8
 file.
8
     * on the inclusion of a file in a particular fileset.
9
     *
9
     *
10
     * @param basedir the base directory the scan is being done from
10
     * @param basedir the base directory the scan is being done from
11
     * @param filename is the name of the file to check
11
     * @param filename is the name of the file to check
12
     * @param file is a java.io.File object the selector can use
12
     * @param file is a java.io.File object the selector can use
13
     * @return whether the file should be selected or not
13
     * @return whether the file should be selected or not
14
     */
14
     */
15
    public boolean isSelected(File basedir, String filename, File file) {
15
    public boolean isSelected(File basedir, String filename, File file) {
16
        return isSelected(new FileResource(file));
16
        return isSelected(new FileResource(file));
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