case INDEPENDENT:
case PAREN:
case MODIFIERGROUP:
return this.getChild(0).getMinLength();
case BACKREFERENCE:
return 0; // *******
case STRING:
return this.getString().length();
case LOOKAHEAD:
case NEGATIVELOOKAHEAD:
case LOOKBEHIND:
case NEGATIVELOOKBEHIND:
return 0; // ***** Really?
default:
throw new RuntimeException("Token#getMinLength(): Invalid Type: "+this.type);
case INDEPENDENT:
case PAREN:
case MODIFIERGROUP:
return this.getChild(0).getMaxLength();
case BACKREFERENCE:
return -1; // ******
case STRING:
return this.getString().length();
case LOOKAHEAD:
case NEGATIVELOOKAHEAD:
case LOOKBEHIND:
case NEGATIVELOOKBEHIND:
return 0; // ***** Really?
default:
throw new RuntimeException("Token#getMaxLength(): Invalid Type: "+this.type);
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: int getMinLength()
|
|
Method name: int getMaxLength()
|
Number of AST nodes: 15
|
|
Number of AST nodes: 15
|
|
1 | case INDEPENDENT:↵ | | 1 | case INDEPENDENT:↵
|
2 | case PAREN:↵ | | 2 | case PAREN:↵
|
3 | case MODIFIERGROUP:↵ | | 3 | case MODIFIERGROUP:↵
|
4 | return this.getChild(0).getMinLength();↵ | | 4 | return this.getChild(0).getMaxLength();↵
|
|
5 | case BACKREFERENCE:↵ | | 5 | case BACKREFERENCE:↵
|
6 | return 0; // *******↵ | | 6 | return -1; // ******↵
|
|
7 | case STRING:↵ | | 7 | case STRING:↵
|
8 | return this.getString().length();↵ | | 8 | return this.getString().length();↵
|
|
9 | case LOOKAHEAD:↵ | | 9 | case LOOKAHEAD:↵
|
10 | case NEGATIVELOOKAHEAD:↵ | | 10 | case NEGATIVELOOKAHEAD:↵
|
11 | case LOOKBEHIND:↵ | | 11 | case LOOKBEHIND:↵
|
12 | case NEGATIVELOOKBEHIND:↵ | | 12 | case NEGATIVELOOKBEHIND:↵
|
13 | return 0; // ***** Really?↵ | | 13 | return 0; // ***** Really?↵
|
|
14 | default:↵ | | 14 | default:↵
|
15 | throw new RuntimeException("Token#getMinLength(): Invalid Type: "+this.type); | | 15 | throw new RuntimeException("Token#getMaxLength(): Invalid Type: "+this.type);
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 125 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 15 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
30 | case INDEPENDENT: | | 37 | case INDEPENDENT: |
31 | case PAREN: | | 38 | case PAREN: |
32 | case MODIFIERGROUP: | | 39 | case MODIFIERGROUP: |
33 | return this.getChild(0).getMinLength(); | | 40 | return this.getChild(0).getMaxLength(); |
34 | case BACKREFERENCE: | | 41 | case BACKREFERENCE: |
35 | return 0; | | 42 | return -1; |
36 | case STRING: | | 43 | case STRING: |
37 | return this.getString().length(); | | 44 | return this.getString().length(); |
38 | case LOOKAHEAD: | | 45 | case LOOKAHEAD: |
39 | case NEGATIVELOOKAHEAD: | | 46 | case NEGATIVELOOKAHEAD: |
40 | case LOOKBEHIND: | | 47 | case LOOKBEHIND: |
41 | case NEGATIVELOOKBEHIND: | | 48 | case NEGATIVELOOKBEHIND: |
42 | return 0; | | 49 | return 0; |
43 | default: | | 50 | default: |
44 | throw new RuntimeException("Token#getMinLength(): Invalid Type: " + this.type); | | 51 | throw new RuntimeException("Token#getMaxLength(): Invalid Type: " + this.type); |
Precondition Violations (0)
Row |
Violation |