File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/criterion/SubqueryExpression.java | File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/sql/hand/query/NativeSQLQueriesTest.java | |||
Method name: SessionImplementor deriveRootSession(Criteria)
|
Method name: double extractDoubleValue(Object)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | if ( criteria instanceof CriteriaImpl ) {↵ | 1 | if ( value instanceof BigInteger ) {↵ | |
2 | return ( ( CriteriaImpl ) criteria ).getSession();↵ | 2 | return ( ( BigInteger ) value ).doubleValue();↵ | |
3 | }↵ | 3 | }↵ | |
4 | else if ( criteria instanceof CriteriaImpl.Subcriteria ) {↵ | 4 | else if ( value instanceof ↵ | |
5 | return deriveRootSession( ( ( CriteriaImpl.Subcriteria ) criteria ).getParent() ↵ | 5 | BigDecimal ) {↵ | |
6 | );↵ | 6 | return ( ( BigDecimal ) value ).doubleValue();↵ | |
7 | }↵ | 7 | }↵ | |
8 | else {↵ | 8 | else {↵ | |
9 | // could happen for custom Criteria impls. Not likely, but...↵ | 9 | ↵ | |
10 | // for long term solution, see HHH-3514↵ | |||
11 | return null;↵ | 10 | return Double.valueOf( value.toString() ).doubleValue();↵ | |
12 | } | 11 |
| |
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.5 |
Clones location | Clones are in different classes |
Number of node comparisons | 20 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 1.4 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||
---|---|---|---|---|---|---|---|---|
|
| 2 | return ((BigInteger)value).doubleValue(); | |||||
2 | return ((CriteriaImpl)criteria).getSession(); |
| | |||||
|
| 3 | else if (value instanceof BigDecimal) | |||||
|
| 4 | return ((BigDecimal)value).doubleValue(); | |||||
| else | |||||||
|
| 5 | return Double.valueOf(value.toString()).doubleValue(); | |||||
3 | else if (criteria instanceof CriteriaImpl.Subcriteria) |
| | |||||
4 | return deriveRootSession(((CriteriaImpl.Subcriteria)criteria).getParent()); |
| | |||||
else | | |||||||
5 | return null; |
| |
Row | Violation |
---|---|
1 | Unmatched statement return ((BigInteger)value).doubleValue(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched return ((BigInteger)value).doubleValue(); |
3 | Unmatched statement return ((CriteriaImpl)criteria).getSession(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Unmatched return ((CriteriaImpl)criteria).getSession(); |
5 | Unmatched statement if(value instanceof BigDecimal) cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
6 | Unmatched statement return ((BigDecimal)value).doubleValue(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
7 | Unmatched return ((BigDecimal)value).doubleValue(); |
8 | Unmatched statement return Double.valueOf(value.toString()).doubleValue(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
9 | Unmatched return Double.valueOf(value.toString()).doubleValue(); |
10 | Unmatched statement if(criteria instanceof CriteriaImpl.Subcriteria) cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
11 | Unmatched statement return deriveRootSession(((CriteriaImpl.Subcriteria)criteria).getParent()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
12 | Unmatched return deriveRootSession(((CriteriaImpl.Subcriteria)criteria).getParent()); |
13 | Unmatched return null; |
14 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero |