try {
if (s != null) {
s.close();
}
} catch (SQLException e) {
log.warn("Error closing Statement " + s.toString(), e);
}
try {
if (c != null) {
c.close();
}
} catch (SQLException e) {
log.warn("Error closing Connection", e);
}
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/jdbc/sampler/JDBCSampler.java
|
|
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/jdbc/sampler/JDBCSampler.java
|
Method name: void close(Statement)
|
|
Method name: void close(Connection)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | try {↵ | | 1 | try {↵
|
2 | if (s != null) {↵ | | 2 | if (c != null) {↵
|
3 | s.close();↵ | | 3 | c.close();↵
|
4 | }↵ | | 4 | }↵
|
5 | } catch (SQLException e) {↵ | | 5 | } catch (SQLException e) {↵
|
6 | log.warn("Error closing Statement " + s.toString(), e);↵ | | 6 | log.warn("Error closing Connection", e);↵
|
7 | } | | 7 | }
|
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 5 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 3 |
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.3 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | try | | 1 | try |
2 | | | 2 | |
3 | | | 3 | |
Precondition Violations (1)
Row |
Violation |
1 | Expression s cannot be unified with expression c , because common superclass java.sql.Wrapper does not declare member(s) public abstract void close() throws java.sql.SQLException |