if (this.fixedStringOnly) {
//System.err.println("DEBUG: fixed-only: "+this.fixedString);
int o = this.fixedStringTable.matches(target, con.start, con.limit);
if (o >= 0) {
if (con.match != null) {
con.match.setBeginning(0, o);
con.match.setEnd(0, o+this.fixedString.length());
}
con.inuse = false;
return true;
}
con.inuse = false;
return false;
}
if (this.fixedStringOnly) {
//System.err.println("DEBUG: fixed-only: "+this.fixedString);
int o = this.fixedStringTable.matches(target, con.start, con.limit);
if (o >= 0) {
if (con.match != null) {
con.match.setBeginning(0, o);
con.match.setEnd(0, o+this.fixedString.length());
}
con.inuse = false;
return true;
}
con.inuse = false;
return false;
}
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: boolean matches(char[], int, int, Match)
|
|
Method name: boolean matches(CharacterIterator, Match)
|
Number of AST nodes: 10
|
|
Number of AST nodes: 10
|
|
1 | if (this.fixedStringOnly) {↵ | | 1 | if (this.fixedStringOnly) {↵
|
2 | //System.err.println("DEBUG: fixed-only: "+this.fixedString);↵ | | 2 | //System.err.println("DEBUG: fixed-only: "+this.fixedString);↵
|
3 | int o = this.fixedStringTable.matches(target, con.start, con.limit);↵ | | 3 | int o = this.fixedStringTable.matches(target, con.start, con.limit);↵
|
4 | if (o >= 0) {↵ | | 4 | if (o >= 0) {↵
|
5 | if (con.match != null) {↵ | | 5 | if (con.match != null) {↵
|
6 | con.match.setBeginning(0, o);↵ | | 6 | con.match.setBeginning(0, o);↵
|
7 | con.match.setEnd(0, o+this.fixedString.length());↵ | | 7 | con.match.setEnd(0, o+this.fixedString.length());↵
|
8 | }↵ | | 8 | }↵
|
9 | con.inuse = false;↵ | | 9 | con.inuse = false;↵
|
10 | return true;↵ | | 10 | return true;↵
|
11 | }↵ | | 11 | }↵
|
12 | con.inuse = false;↵ | | 12 | con.inuse = false;↵
|
13 | return false;↵ | | 13 | return false;↵
|
14 | } | | 14 | }
|
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 34 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 10 |
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) | 2.2 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
26 | if (this.fixedStringOnly) | | 28 | if (this.fixedStringOnly) |
27 | int o = this.fixedStringTable.matches(target, con.start, con.limit); | | 29 | int o = this.fixedStringTable.matches(target, con.start, con.limit); |
28 | | | 30 | |
29 | | | 31 | |
30 | con.match.setBeginning(0, o); | | 32 | con.match.setBeginning(0, o); |
31 | con.match.setEnd(0, o + this.fixedString.length()); | | 33 | con.match.setEnd(0, o + this.fixedString.length()); |
32 | | | 34 | |
33 | | | 35 | |
34 | | | 36 | |
35 | | | 37 | |
Precondition Violations (5)
Row |
Violation |
1 | Type char[] of variable target does not match with type java.text.CharacterIterator of variable target |
2 | Conditional return true; |
3 | Conditional return true; |
4 | Conditional return false; |
5 | Conditional return false; |