File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/impl/SessionImpl.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/impl/SessionImpl.java | |||
Method name: Iterator iterate(String, QueryParameters)
|
Method name: ScrollableResults scroll(String, QueryParameters)
|
|||
Number of AST nodes: 8 | Number of AST nodes: 7 | |||
1 | errorIfClosed();↵ | 1 | errorIfClosed();↵ | |
2 | checkTransactionSynchStatus();↵ | 2 | checkTransactionSynchStatus();↵ | |
3 | queryParameters.validateParameters();↵ | 3 | ↵ | |
4 | HQLQueryPlan plan = getHQLQueryPlan( query, true );↵ | 4 | HQLQueryPlan plan = getHQLQueryPlan( query, false );↵ | |
5 | autoFlushIfRequired( plan.getQuerySpaces() );↵ | 5 | autoFlushIfRequired( plan.getQuerySpaces() );↵ | |
6 | dontFlushFromFind++; //stops flush being called multiple times if this method is recursively called↵ | 6 | dontFlushFromFind++;↵ | |
7 | try {↵ | 7 | try {↵ | |
8 | return plan.performIterate( queryParameters, this );↵ | 8 | return plan.performScroll( queryParameters, this );↵ | |
9 | }↵ | 9 | }↵ | |
10 | finally {↵ | 10 | finally {↵ | |
11 | dontFlushFromFind--;↵ | 11 | dontFlushFromFind--;↵ | |
12 | } | 12 |
| |
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) | 0.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 25 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 2.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | errorIfClosed(); | 1 | errorIfClosed(); | |||||||||||
2 | checkTransactionSynchStatus(); | 2 | checkTransactionSynchStatus(); | |||||||||||
3 | queryParameters.validateParameters(); | | ||||||||||||
4 | HQLQueryPlan plan = getHQLQueryPlan(query, true); |
| 3 | HQLQueryPlan plan = getHQLQueryPlan(query, false); | ||||||||||
5 | autoFlushIfRequired(plan.getQuerySpaces()); | 4 | autoFlushIfRequired(plan.getQuerySpaces()); | |||||||||||
6 | dontFlushFromFind++; | 5 | dontFlushFromFind++; | |||||||||||
7 | try | 6 | try | |||||||||||
|
| 7 | return plan.performScroll(queryParameters, this); | |||||||||||
8 | return plan.performIterate(queryParameters, this); |
| |
Row | Violation |
---|---|
1 | Unmatched statement return plan.performScroll(queryParameters,this); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
2 | Unmatched statement return plan.performIterate(queryParameters,this); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |