try {
if (needsReset) stream.reset();
}
catch (IOException ioe) {
throw new SQLException("could not reset reader");
}
needsReset = true;
return stream;
try {
if (needsReset) reader.reset();
}
catch (IOException ioe) {
throw new SQLException("could not reset reader");
}
needsReset = true;
return reader;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/lob/BlobImpl.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/lob/ClobImpl.java
|
Method name: InputStream getBinaryStream()
|
|
Method name: Reader getCharacterStream()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | try {↵ | | 1 | try {↵
|
2 | if (needsReset) stream.reset();↵ | | 2 | if (needsReset) reader.reset();↵
|
3 | }↵ | | 3 | }↵
|
4 | catch (IOException ioe) {↵ | | 4 | catch (IOException ioe) {↵
|
5 | throw new SQLException("could not reset reader");↵ | | 5 | throw new SQLException("could not reset reader");↵
|
6 | }↵ | | 6 | }↵
|
7 | needsReset = true;↵ | | 7 | needsReset = true;↵
|
8 | return stream; | | 8 | return reader;
|
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 | 7 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | try | | 1 | try |
2 | | | 2 | |
3 | | | 3 | |
4 | needsReset = true; | | 4 | needsReset = true; |
| | | 5 | return reader; |
5 | return stream; | | | |
Precondition Violations (3)
Row |
Violation |
1 | Type java.io.InputStream of variable stream does not match with type java.io.Reader of variable reader |
2 | Unmatched return reader; |
3 | Unmatched return stream; |