else if (this == Token.token_wordchars) ret = "\\w"; else if (this == Token.token_spaces) ret = "\\s"; else { StringBuffer sb = new StringBuffer(); sb.append("["); for (int i = 0; i < this.ranges.length; i += 2) { if ((options & RegularExpression.SPECIAL_COMMA) != 0 && i > 0) sb.append(","); if (this.ranges[i] == this.ranges[i+1]) { sb.append(escapeCharInCharClass(this.ranges[i])); } else { sb.append(escapeCharInCharClass(this.ranges[i])); sb.append('-'); sb.append(escapeCharInCharClass(this.ranges[i+1])); } } sb.append("]"); ret = sb.toString();
else if (this == Token.token_not_wordchars) ret = "\\W"; else if (this == Token.token_not_spaces) ret = "\\S"; else { StringBuffer sb = new StringBuffer(); sb.append("[^"); for (int i = 0; i < this.ranges.length; i += 2) { if ((options & RegularExpression.SPECIAL_COMMA) != 0 && i > 0) sb.append(","); if (this.ranges[i] == this.ranges[i+1]) { sb.append(escapeCharInCharClass(this.ranges[i])); } else { sb.append(escapeCharInCharClass(this.ranges[i])); sb.append('-'); sb.append(escapeCharInCharClass(this.ranges[i+1])); } } sb.append("]"); ret = sb.toString();
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/internal/RegEx.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/internal/RegEx.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
else if (this == Token.token_wordchars)
1
else if (this == Token.token_not_wordchars)
2
                ret = "\\w";
2
                ret = "\\W";
3
            else if (this == Token.token_spaces)
3
            else if (this == Token.token_not_spaces)
4
                ret = "\\s";
4
                ret = "\\S";
5
            else {
5
            else {
6
                StringBuffer sb = new StringBuffer();
6
                StringBuffer sb = new StringBuffer();
7
                sb.append("[");
7
                sb.append("[^");
8
                for (int i = 0;  i < this.ranges.length;  i += 2) {
8
                for (int i = 0;  i < this.ranges.length;  i += 2) {
9
                    if ((options & RegularExpression.SPECIAL_COMMA) != 0 && i > 0)  sb.append(",");
9
                    if ((options & RegularExpression.SPECIAL_COMMA) != 0 && i > 0)  sb.append(",");
10
                    if (this.ranges[i] == this.ranges[i+1]) {
10
                    if (this.ranges[i] == this.ranges[i+1]) {
11
                        sb.append(escapeCharInCharClass(this.ranges[i]));
11
                        sb.append(escapeCharInCharClass(this.ranges[i]));
12
                    } else {
12
                    } else {
13
                        sb.append(escapeCharInCharClass(this.ranges[i]));
13
                        sb.append(escapeCharInCharClass(this.ranges[i]));
14
                        sb.append('-');
14
                        sb.append('-');
15
                        sb.append(escapeCharInCharClass(this.ranges[i+1]));
15
                        sb.append(escapeCharInCharClass(this.ranges[i+1]));
16
                    }
16
                    }
17
                }
17
                }
18
                sb.append("]");
18
                sb.append("]");
19
                ret = sb.toString();
19
                ret = sb.toString();
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