char c = argument.charAt(i); if (c == '$') { subst.append('\\'); subst.append('$'); } else if (c == '\\') { if (++i < argument.length()) { c = argument.charAt(i); int value = Character.digit(c, 10); if (value > -1) { subst.append("$").append(value); } else { subst.append(c); } } else { // XXX - should throw an exception instead? subst.append('\\'); } } else { subst.append(c);
char c = argument.charAt(i); if (c == '$') { subst.append('\\'); subst.append('$'); } else if (c == '\\') { if (++i < argument.length()) { c = argument.charAt(i); int value = Character.digit(c, 10); if (value > -1) { subst.append("$").append(value); } else { subst.append(c); } } else { // XXX - should throw an exception instead? subst.append('\\'); } } else { subst.append(c);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/regexp/JakartaOroRegexp.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/regexp/Jdk14RegexpRegexp.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
char c = argument.charAt(i);
1
char c = argument.charAt(i);
2
            if (c == '$') {
2
            if (c == '$') {
3
                subst.append('\\');
3
                subst.append('\\');
4
                subst.append('$');
4
                subst.append('$');
5
            } else if (c == '\\') {
5
            } else if (c == '\\') {
6
                if (++i < argument.length()) {
6
                if (++i < argument.length()) {
7
                    c = argument.charAt(i);
7
                    c = argument.charAt(i);
8
                    int value = Character.digit(c, 10);
8
                    int value = Character.digit(c, 10);
9
                    if (value > -1) {
9
                    if (value > -1) {
10
                        subst.append("$").append(value);
10
                        subst.append("$").append(value);
11
                    } else {
11
                    } else {
12
                        subst.append(c);
12
                        subst.append(c);
13
                    }
13
                    }
14
                } else {
14
                } else {
15
                    // XXX - should throw an exception instead?
15
                    // XXX - should throw an exception instead?
16
                    subst.append('\\');
16
                    subst.append('\\');
17
                }
17
                }
18
            } else {
18
            } else {
19
                subst.append(c);
19
                subst.append(c);
20
            
20
            
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