logOpenPreparedStatement();
CallableStatement ps = ( CallableStatement ) getPreparedStatement(
connectionManager.getConnection(),
sql,
scrollable,
false,
null,
scrollMode,
true
);
setStatementFetchSize( ps );
statementsToClose.add( ps );
lastQuery = ps;
return ps;
logOpenPreparedStatement();
PreparedStatement ps = getPreparedStatement(
connectionManager.getConnection(),
sql,
scrollable,
scrollMode
);
setStatementFetchSize( ps );
statementsToClose.add( ps );
lastQuery = ps;
return ps;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/jdbc/AbstractBatcher.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/jdbc/AbstractBatcher.java
|
Method name: CallableStatement prepareCallableQueryStatement(String, boolean, ScrollMode)
|
|
Method name: PreparedStatement prepareQueryStatement(String, boolean, ScrollMode)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | logOpenPreparedStatement();↵ | | 1 | logOpenPreparedStatement();↵
|
2 | CallableStatement ps = ( CallableStatement ) getPreparedStatement(↵ | | 2 | PreparedStatement ps = getPreparedStatement(↵
|
3 | connectionManager.getConnection(),↵ | | 3 | connectionManager.getConnection(),↵
|
4 | sql,↵ | | 4 | sql,↵
|
5 | scrollable,↵ | | 5 | scrollable,↵
|
6 | false,↵ | | 6 | ↵
|
7 | null,↵ | | |
|
8 | scrollMode,↵ | | |
|
9 | true↵ | | 7 | scrollMode↵
|
10 | );↵ | | 8 | );↵
|
11 | setStatementFetchSize( ps );↵ | | 9 | setStatementFetchSize( ps );↵
|
12 | statementsToClose.add( ps );↵ | | 10 | statementsToClose.add( ps );↵
|
13 | lastQuery = ps;↵ | | 11 | lastQuery = ps;↵
|
14 | return ps; | | 12 | return ps;
|
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.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 36 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | logOpenPreparedStatement(); | | 1 | logOpenPreparedStatement(); |
| | | 2 | PreparedStatement ps = getPreparedStatement(connectionManager.getConnection(), sql, scrollable, scrollMode); |
2 | CallableStatement ps = (CallableStatement)getPreparedStatement(connectionManager.getConnection(), sql, scrollable, false, null, scrollMode, true); | | | |
3 | setStatementFetchSize(ps); | | 3 | setStatementFetchSize(ps); |
4 | statementsToClose.add(ps); | | 4 | statementsToClose.add(ps); |
| | | 5 | lastQuery = ps; |
5 | lastQuery = ps; | | | |
| | | 6 | return ps; |
6 | return ps; | | | |
Precondition Violations (4)
Row |
Violation |
1 | Type java.sql.CallableStatement of variable ps does not match with type java.sql.PreparedStatement of variable ps |
2 | Type java.sql.CallableStatement of variable ps does not match with type java.sql.PreparedStatement of variable ps |
3 | Unmatched return ps; |
4 | Unmatched return ps; |