while (off < this.regexlen
&& (ch = this.regex.charAt(off++)) >= '0' && ch <= '9') {
min = min*10 +ch-'0';
if (min < 0)
throw ex("parser.quantifier.5", this.offset);
}
while (off < this.regexlen
&& (ch = this.regex.charAt(off++)) >= '0'
&& ch <= '9') {
max = max*10 +ch-'0';
if (max < 0)
throw ex("parser.quantifier.5", this.offset);
}
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: Token parseFactor()
|
|
Method name: Token parseFactor()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | while (off < this.regexlen↵ | | 1 | while (off < this.regexlen↵
|
2 | && (ch = this.regex.charAt(off++)) >= '0'↵ | | 2 | && (ch = this.regex.charAt(off++)) >= '0'↵
|
3 | && ch <= '9') {↵ | | 3 | && ch <= '9') {↵
|
4 | min = min*10 +ch-'0';↵ | | 4 | max = max*10 +ch-'0';↵
|
5 | if (min < 0)↵ | | 5 | if (max < 0)↵
|
6 | throw ex("parser.quantifier.5", this.offset);↵ | | 6 | throw ex("parser.quantifier.5", this.offset);↵
|
7 | } | | 7 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 1.0 |
Clones location | Clones are in the same method |
Number of node comparisons | 9 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 1.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
50 | while (off < this.regexlen && (ch = this.regex.charAt(off++)) >= '0' && ch <= '9') | | 61 | while (off < this.regexlen && (ch = this.regex.charAt(off++)) >= '0' && ch <= '9') |
51 | min = min * 10 + ch - '0'; | | 62 | max = max * 10 + ch - '0'; |
52 | | | 63 | |
53 | throw ex("parser.quantifier.5", this.offset); | | 64 | throw ex("parser.quantifier.5", this.offset); |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables min, ch, off , while Clone fragment #2 returns variables max, ch, off |