while (this.offset < this.regexlen) {
ch = this.regex.charAt(this.offset);
int v = REUtil.getOptionValue(ch);
if (v == 0) break; // '-' or ':'?
add |= v;
this.offset ++;
}
if (this.offset >= this.regexlen) throw ex("parser.factor.2", this.offset-1);
while (this.offset < this.regexlen) {
ch = this.regex.charAt(this.offset);
int v = REUtil.getOptionValue(ch);
if (v == 0) break; // ':'?
mask |= v;
this.offset ++;
}
if (this.offset >= this.regexlen) throw ex("parser.factor.2", this.offset-1);
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 processModifiers()
|
|
Method name: Token processModifiers()
|
Number of AST nodes: 9
|
|
Number of AST nodes: 9
|
|
1 | while (this.offset < this.regexlen) {↵ | | 1 | while (this.offset < this.regexlen) {↵
|
2 | ch = this.regex.charAt(this.offset);↵ | | 2 | ch = this.regex.charAt(this.offset);↵
|
3 | int v = REUtil.getOptionValue(ch);↵ | | 3 | int v = REUtil.getOptionValue(ch);↵
|
4 | if (v == 0) break; // '-' or ':'?↵ | | 4 | if (v == 0) break; // ':'?↵
|
5 | add |= v;↵ | | 5 | mask |= v;↵
|
6 | this.offset ++;↵ | | 6 | this.offset ++;↵
|
7 | }↵ | | 7 | ↵
|
| | | 8 | }↵
|
8 | if (this.offset >= this.regexlen) throw ex("parser.factor.2", this.offset-1); | | 9 | if (this.offset >= this.regexlen) throw ex("parser.factor.2", this.offset-1);
|
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) | 0.3 |
Clones location | Clones are in the same method |
Number of node comparisons | 34 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 9 |
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.3 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | while (this.offset < this.regexlen) | | 13 | while (this.offset < this.regexlen) |
3 | ch = this.regex.charAt(this.offset); | | 14 | ch = this.regex.charAt(this.offset); |
4 | int v = REUtil.getOptionValue(ch); | | 15 | int v = REUtil.getOptionValue(ch); |
5 | | | 16 | |
6 | | | 17 | |
7 | | | 18 | |
8 | | | 19 | |
9 | if (this.offset >= this.regexlen) | | 20 | if (this.offset >= this.regexlen) |
10 | throw ex("parser.factor.2", this.offset - 1); | | 21 | throw ex("parser.factor.2", this.offset - 1); |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables ch, add , while Clone fragment #2 returns variables ch, mask |