return OUT_OF_BOUNDS;
} else if (index >= bufsize) {
// Allocate more space in the buffer.
try {
while (bufsize <= index) bufsize += BUFFER_INCREMENT;
br.reset();
br.mark(bufsize);
br.skip(index-1);
} catch (IOException e) { }
} else if (this.index != index) {
try {
br.reset();
br.skip(index-1);
} catch (IOException e) { }
}
return OUT_OF_BOUNDS;
} else if (index >= bufsize) {
// Allocate more space in the buffer.
try {
while (bufsize <= index) bufsize += BUFFER_INCREMENT;
br.reset();
br.mark(bufsize);
br.skip(index-1);
} catch (IOException e) { }
} else if (this.index != index) {
try {
br.reset();
br.skip(index-1);
} catch (IOException e) { }
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: 12
|
|
Number of AST nodes: 10
|
|
1 | return OUT_OF_BOUNDS;↵ | | 1 | return OUT_OF_BOUNDS;↵
|
2 | } else if (index >= bufsize) {↵ | | 2 | } else if (index >= bufsize) {↵
|
3 | // Allocate more space in the buffer.↵ | | 3 | // Allocate more space in the buffer.↵
|
4 | try {↵ | | 4 | try {↵
|
5 | while (bufsize <= index) bufsize += BUFFER_INCREMENT;↵ | | 5 | while (bufsize <= index) bufsize += BUFFER_INCREMENT;↵
|
6 | br.reset();↵ | | 6 | br.reset();↵
|
7 | br.mark(bufsize);↵ | | 7 | br.mark(bufsize);↵
|
8 | br.skip(index-1);↵ | | 8 | br.skip(index-1);↵
|
9 | } catch (IOException e) { }↵ | | 9 | } catch (IOException e) { }↵
|
10 | } else if (this.index != index) {↵ | | 10 | } else if (this.index != index) {↵
|
11 | try {↵ | | 11 | try {↵
|
12 | br.reset();↵ | | 12 | br.reset();↵
|
13 | br.skip(index-1);↵ | | 13 | br.skip(index-1);↵
|
14 | } catch (IOException e) { }↵ | | 14 | } catch (IOException e) { }
|
15 | } | | | |
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 | 22 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 6 |
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.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
12 | try | | 6 | try |
13 | | | 7 | |
14 | bufsize += BUFFER_INCREMENT; | | 8 | bufsize += BUFFER_INCREMENT; |
15 | | | 9 | |
16 | | | 10 | |
17 | | | 11 | |
Precondition Violations (3)
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 |