end--; // closer to end
try {
if (index != -1) {
br.reset();
}
int i = br.read();
br.mark(bufsize);
if (i == -1) {
end = 1;
cached = OUT_OF_BOUNDS;
return false;
}
cached = (char) i;
index = 1;
} catch (IOException e) {
e.printStackTrace();
cached = OUT_OF_BOUNDS;
return false;
}
return true;
end--; // closer to end
try {
if (index != -1) {
br.reset();
}
int i = br.read();
br.mark(bufsize);
if (i == -1) {
end = 1;
cached = OUT_OF_BOUNDS;
return false;
}
// convert the byte read into a char
cached = (char) i;
index = 1;
} catch (IOException e) {
e.printStackTrace();
cached = OUT_OF_BOUNDS;
return false;
}
return true;
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: boolean next()
|
|
Method name: boolean next()
|
Number of AST nodes: 13
|
|
Number of AST nodes: 13
|
|
1 | end--; // closer to end↵ | | 1 | end--; // closer to end↵
|
| | | 2 | ↵
|
2 | try {↵ | | 3 | try {↵
|
3 | if (index != -1) {↵ | | 4 | if (index != -1) {↵
|
4 | br.reset();↵ | | 5 | br.reset();↵
|
5 | }↵ | | 6 | }↵
|
6 | int i = br.read();↵ | | 7 | int i = br.read();↵
|
7 | br.mark(bufsize);↵ | | 8 | br.mark(bufsize);↵
|
8 | if (i == -1) {↵ | | 9 | if (i == -1) {↵
|
9 | end = 1;↵ | | 10 | end = 1;↵
|
10 | cached = OUT_OF_BOUNDS;↵ | | 11 | cached = OUT_OF_BOUNDS;↵
|
11 | return false;↵ | | 12 | return false;↵
|
12 | }↵ | | 13 | }↵
|
|
| | | 14 | // convert the byte read into a char↵
|
13 | cached = (char) i;↵ | | 15 | cached = (char) i;↵
|
14 | index = 1;↵ | | 16 | index = 1;↵
|
15 | } catch (IOException e) { ↵ | | 17 | } catch (IOException e) { ↵
|
16 | e.printStackTrace();↵ | | 18 | e.printStackTrace();↵
|
17 | cached = OUT_OF_BOUNDS;↵ | | 19 | cached = OUT_OF_BOUNDS;↵
|
18 | return false; ↵ | | 20 | return false; ↵
|
19 | }↵ | | 21 | }↵
|
20 | return true; | | 22 | return true;
|
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 different classes |
Number of node comparisons | 56 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 13 |
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.9 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
3 | end--; | | 6 | end--; |
4 | try | | 7 | try |
5 | | | 8 | |
6 | | | 9 | |
7 | | | 10 | |
8 | | | 11 | |
9 | | | 12 | |
10 | | | 13 | |
11 | | | 14 | |
12 | | | 15 | |
13 | | | 16 | |
14 | | | 17 | |
15 | return true; | | 18 | return true; |
Precondition Violations (5)
Row |
Violation |
1 | Type java.io.BufferedInputStream of variable br does not match with type java.io.BufferedReader of variable br |
2 | Type java.io.BufferedInputStream of variable br does not match with type java.io.BufferedReader of variable br |
3 | Type java.io.BufferedInputStream of variable br does not match with type java.io.BufferedReader of variable br |
4 | Conditional return false; |
5 | Conditional return false; |