char ch = OUT_OF_BOUNDS;
try {
int i = br.read();
this.index = index+1; // this.index is index of next pos relative to charAt(0)
if (i == -1) {
// set flag that next should fail next time?
end = index;
return ch;
}
ch = (char) i;
} catch (IOException ie) { }
return ch;
char ch = OUT_OF_BOUNDS;
try {
int i = br.read();
this.index = index+1; // this.index is index of next pos relative to charAt(0)
if (i == -1) {
// set flag that next should fail next time?
end = index;
return ch;
}
ch = (char) i;
} catch (IOException ie) { }
return ch;
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/gnu/regexp/CharIndexedInputStream.java
|
|
File path: /jEdit-4.2/src/gnu/regexp/CharIndexedReader.java
|
Method name: char charAt(int)
|
|
Method name: char charAt(int)
|
Number of AST nodes: 9
|
|
Number of AST nodes: 9
|
|
1 | char ch = OUT_OF_BOUNDS;↵ | | 1 | char ch = OUT_OF_BOUNDS;↵
|
2 | ↵ | | 2 | ↵
|
3 | try {↵ | | 3 | try {↵
|
4 | int i = br.read();↵ | | 4 | int i = br.read();↵
|
5 | this.index = index+1; // this.index is index of next pos relative to charAt(0)↵ | | 5 | this.index = index+1; // this.index is index of next pos relative to charAt(0)↵
|
6 | if (i == -1) {↵ | | 6 | if (i == -1) {↵
|
7 | // set flag that next should fail next time?↵ | | 7 | // set flag that next should fail next time?↵
|
8 | end = index;↵ | | 8 | end = index;↵
|
9 | return ch;↵ | | 9 | return ch;↵
|
10 | }↵ | | 10 | }↵
|
11 | ch = (char) i;↵ | | 11 | ch = (char) i;↵
|
12 | } catch (IOException ie) { }↵ | | 12 | } catch (IOException ie) { }↵
|
13 | ↵ | | 13 | ↵
|
14 | return ch; | | 14 | return ch;
|
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 in different classes |
Number of node comparisons | 29 |
-
{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 |
22 | char ch = OUT_OF_BOUNDS; | | 22 | char ch = OUT_OF_BOUNDS; |
23 | try | | 23 | try |
24 | | | 24 | |
25 | | | 25 | |
26 | | | 26 | |
27 | | | 27 | |
28 | | | 28 | |
29 | | | 29 | |
30 | return ch; | | 30 | return ch; |
Precondition Violations (1)
Row |
Violation |
1 | Type java.io.BufferedInputStream of variable br does not match with type java.io.BufferedReader of variable br |