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;
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;
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: 10
|
|
Number of AST nodes: 10
|
|
1 | if (index != -1) {↵ | | 1 | if (index != -1) {↵
|
2 | br.reset();↵ | | 2 | br.reset();↵
|
3 | }↵ | | 3 | }↵
|
4 | int i = br.read();↵ | | 4 | int i = br.read();↵
|
5 | br.mark(bufsize);↵ | | 5 | br.mark(bufsize);↵
|
6 | if (i == -1) {↵ | | 6 | if (i == -1) {↵
|
7 | end = 1;↵ | | 7 | end = 1;↵
|
8 | cached = OUT_OF_BOUNDS;↵ | | 8 | cached = OUT_OF_BOUNDS;↵
|
9 | return false;↵ | | 9 | return false;↵
|
10 | }↵ | | 10 | }↵
|
|
| | | 11 | // convert the byte read into a char↵
|
11 | cached = (char) i;↵ | | 12 | cached = (char) i;↵
|
12 | index = 1; | | 13 | index = 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) | 2.0 |
Clones location | Clones are in different classes |
Number of node comparisons | 37 |
-
{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) | 3.1 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
5 | if (index != -1) | | 8 | if (index != -1) |
6 | | | 9 | |
7 | int i = br.read(); | | 10 | int i = br.read(); |
8 | br.mark(bufsize); | | 11 | br.mark(bufsize); |
9 | if (i == -1) | | 12 | if (i == -1) |
10 | | | 13 | |
11 | | | 14 | |
12 | | | 15 | |
13 | cached = (char)i; | | 16 | cached = (char)i; |
14 | index = 1; | | 17 | index = 1; |
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; |