if (!found) {
int n = refillBuffer();
if (n <= 0) {
if (n < 0 && totalRead < 1) {
return -1;
}
break;
}
}
if (!found) {
int n = refillBuffer();
if (n <= 0) {
if (n < 0 && totalRead < 1) {
return -1;
}
break;
}
}
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/util/io/ChannelStream.java
|
|
File path: /jruby-1.4.0/src/org/jruby/util/io/ChannelStream.java
|
Method name: int getline(ByteList, byte, long)
|
|
Method name: int getline(ByteList, byte)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | if (!found) {↵ | | 1 | if (!found) {↵
|
2 | int n = refillBuffer();↵ | | 2 | int n = refillBuffer();↵
|
3 | if (n <= 0) {↵ | | 3 | if (n <= 0) {↵
|
4 | if (n < 0 && totalRead < 1) {↵ | | 4 | if (n < 0 && totalRead < 1) {↵
|
5 | return -1;↵ | | 5 | return -1;↵
|
6 | }↵ | | 6 | }↵
|
7 | break;↵ | | 7 | break;↵
|
8 | }↵ | | 8 | }↵
|
9 | } | | 9 | }
|
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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 14 |
-
{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.1 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
25 | if (!found) | | 22 | if (!found) |
26 | | | 23 | |
27 | | | 24 | |
28 | if (n < 0 && totalRead < 1) | | 25 | if (n < 0 && totalRead < 1) |
29 | | | 26 | |
30 | | | 27 | |
Precondition Violations (2)
Row |
Violation |
1 | Statement break; without innermost loop |
2 | Statement break; without innermost loop |