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: 17 | Number of AST nodes: 17 | |||
1 | if (index == -1) {↵ | |||
2 | return lookBehind[0];↵ | |||
3 | } else if (index == -2) {↵ | |||
4 | return lookBehind[1];↵ | |||
5 | } else if (index < -2) {↵ | |||
6 | return OUT_OF_BOUNDS;↵ | |||
7 | } else if (index >= bufsize) {↵ | 1 | if (index >= bufsize) {↵ | |
8 | // Allocate more space in the buffer.↵ | 2 | // Allocate more space in the buffer.↵ | |
9 | try {↵ | 3 | try {↵ | |
10 | while (bufsize <= index) bufsize += BUFFER_INCREMENT;↵ | 4 | while (bufsize <= index) bufsize += BUFFER_INCREMENT;↵ | |
11 | br.reset();↵ | 5 | br.reset();↵ | |
12 | br.mark(bufsize);↵ | 6 | br.mark(bufsize);↵ | |
13 | br.skip(index-1);↵ | 7 | br.skip(index-1);↵ | |
14 | } catch (IOException e) { }↵ | 8 | } catch (IOException e) { }↵ | |
15 | } else if (this.index != index) {↵ | 9 | } else if (this.index != index) {↵ | |
16 | try {↵ | 10 | try {↵ | |
17 | br.reset();↵ | 11 | br.reset();↵ | |
18 | br.skip(index-1);↵ | 12 | br.skip(index-1);↵ | |
19 | } catch (IOException e) { }↵ | 13 | } catch (IOException e) { }↵ | |
20 | } | 14 | } else if (index == -1) {↵ | |
15 | return lookBehind[0];↵ | |||
16 | } else if (index == -2) {↵ | |||
17 | return lookBehind[1];↵ | |||
18 | } else if (index < -2) {↵ | |||
19 | return OUT_OF_BOUNDS;↵ | |||
20 |
| |||
See real code fragment | See real code fragment |
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 72 |
Number of mapped statements | 17 |
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.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5 | else if (index == -1) | 16 | else if (index == -1) | ||||||||||||
6 | return lookBehind[0]; | 17 | return lookBehind[0]; | ||||||||||||
7 | else if (index == -2) | 18 | else if (index == -2) | ||||||||||||
8 | return lookBehind[1]; | 19 | return lookBehind[1]; | ||||||||||||
9 | else if (index < -2) | 20 | else if (index < -2) | ||||||||||||
10 | return OUT_OF_BOUNDS; | 21 | return OUT_OF_BOUNDS; | ||||||||||||
11 | else if (index >= bufsize) | 5 | else if (index >= bufsize) | ||||||||||||
12 | try | 6 | try | ||||||||||||
13 | while (bufsize <= index) | 7 | while (bufsize <= index) | ||||||||||||
14 | bufsize += BUFFER_INCREMENT; | 8 | bufsize += BUFFER_INCREMENT; | ||||||||||||
15 | br.reset(); |
| 9 | br.reset(); | |||||||||||
16 | br.mark(bufsize); |
| 10 | br.mark(bufsize); | |||||||||||
17 | br.skip(index - 1); |
| 11 | br.skip(index - 1); | |||||||||||
18 | else if (this.index != index) | 12 | else if (this.index != index) | ||||||||||||
19 | try | 13 | try | ||||||||||||
20 | br.reset(); |
| 14 | br.reset(); | |||||||||||
21 | br.skip(index - 1); |
| 15 | br.skip(index - 1); |
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 | Type java.io.BufferedInputStream of variable br does not match with type java.io.BufferedReader of variable br |
5 | Type java.io.BufferedInputStream of variable br does not match with type java.io.BufferedReader of variable br |