getMatch(); int cnt = mr.groups(); for (int i = 0; i < cnt; i++) { String match = mr.group(i); // treat non-matching groups as empty matches if (match == null) { match = ""; } v.addElement(match); } return v; } /** * Convert the generic options to the regex compiler specific options. * @param options the generic options * @return the specific options */ protected int getCompilerOptions(int options) { int cOptions = Perl5Compiler.DEFAULT_MASK; if (RegexpUtil.hasFlag(options, MATCH_CASE_INSENSITIVE)) { cOptions |= Perl5Compiler.CASE_INSENSITIVE_MASK; } if (RegexpUtil.hasFlag(options, MATCH_MULTILINE)) { cOptions |= Perl5Compiler.MULTILINE_MASK; } if (RegexpUtil.hasFlag(options, MATCH_SINGLELINE)) { cOptions |= Perl5Compiler.SINGLELINE_MASK; } return cOptions;
Vector(); int cnt = reg.getParenCount(); for (int i = 0; i < cnt; i++) { String match = reg.getParen(i); // treat non-matching groups as empty matches if (match == null) { match = ""; } v.addElement(match); } return v; } /** * Convert the generic options to the regex compiler specific options. * @param options the generic options * @return the specific options */ protected int getCompilerOptions(int options) { int cOptions = RE.MATCH_NORMAL; if (RegexpUtil.hasFlag(options, MATCH_CASE_INSENSITIVE)) { cOptions |= RE.MATCH_CASEINDEPENDENT; } if (RegexpUtil.hasFlag(options, MATCH_MULTILINE)) { cOptions |= RE.MATCH_MULTILINE; } if (RegexpUtil.hasFlag(options, MATCH_SINGLELINE)) { cOptions |= RE.MATCH_SINGLELINE; } return cOptions;
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/regexp/JakartaOroMatcher.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/regexp/JakartaRegexpMatcher.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
getMatch();
1
Vector();
2
        int cnt = mr.groups();
2
        int cnt = reg.getParenCount();
3
        for (int i = 0; i < cnt; i++) {
3
        for (int i = 0; i < cnt; i++) {
4
            String match = mr.group(i);
4
            String match = reg.getParen(i);
5
            // treat non-matching groups as empty matches
5
            // treat non-matching groups as empty matches
6
            if (match == null) {
6
            if (match == null) {
7
                match = "";
7
                match = "";
8
            }
8
            }
9
            v.addElement(match);
9
            v.addElement(match);
10
        }
10
        }
11
        return v;
11
        return v;
12
    }
12
    }
13
    /**
13
    /**
14
     * Convert the generic options to the regex compiler specific options.
14
     * Convert the generic options to the regex compiler specific options.
15
     * @param options the generic options
15
     * @param options the generic options
16
     * @return the specific options
16
     * @return the specific options
17
     */
17
     */
18
    protected int getCompilerOptions(int options) {
18
    protected int getCompilerOptions(int options) {
19
        int cOptions = Perl5Compiler.DEFAULT_MASK;
19
        int cOptions = RE.MATCH_NORMAL;
20
        if (RegexpUtil.hasFlag(options, MATCH_CASE_INSENSITIVE)) {
20
        if (RegexpUtil.hasFlag(options, MATCH_CASE_INSENSITIVE)) {
21
            cOptions |= Perl5Compiler.CASE_INSENSITIVE_MASK;
21
            cOptions |= RE.MATCH_CASEINDEPENDENT;
22
        }
22
        }
23
        if (RegexpUtil.hasFlag(options, MATCH_MULTILINE)) {
23
        if (RegexpUtil.hasFlag(options, MATCH_MULTILINE)) {
24
            cOptions |= Perl5Compiler.MULTILINE_MASK;
24
            cOptions |= RE.MATCH_MULTILINE;
25
        }
25
        }
26
        if (RegexpUtil.hasFlag(options, MATCH_SINGLELINE)) {
26
        if (RegexpUtil.hasFlag(options, MATCH_SINGLELINE)) {
27
            cOptions |= Perl5Compiler.SINGLELINE_MASK;
27
            cOptions |= RE.MATCH_SINGLELINE;
28
        }
28
        }
29
        return cOptions;
29
        return cOptions;
30
    
30
    
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