File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java | |||
Method name: int writeKey(PreparedStatement, Serializable, int, SessionImplementor)
|
Method name: int writeElementToWhere(PreparedStatement, Object, int, SessionImplementor)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | if ( key == null ) {↵ | 1 | if (↵ | |
2 | throw new NullPointerException( "null key for collection: " + role ); //an asser↵ | 2 | elementIsPureFormula) {↵ | |
3 | tion↵ | 3 | throw new AssertionFailure("cannot use a formula-based element in the where condition");↵ | |
4 | }↵ | 4 | }↵ | |
5 | getKeyType().nullSafeSet( st, key, i, session );↵ | 5 | getElementType().nullSafeSet(st, elt, i, elementColumnIsInPrimaryKey, session);↵ | |
6 | return i + keyColumnAliases.length; | 6 | return i + elementColumnAliases.length; | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
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 | 5 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 3.7 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | if (elementIsPureFormula) | ||||||||||||||||||
|
| 2 | throw new AssertionFailure("cannot use a formula-based element in the where condition"); | |||||||||||||||||
1 | if (key == null) | | ||||||||||||||||||
2 | throw new NullPointerException("null key for collection: " + role); |
| | |||||||||||||||||
3 | getKeyType().nullSafeSet(st, key, i, session); |
| 3 | getElementType().nullSafeSet(st, elt, i, elementColumnIsInPrimaryKey, session); | ||||||||||||||||
4 | return i + keyColumnAliases.length; |
| 4 | return i + elementColumnAliases.length; |
Row | Violation |
---|---|
1 | Unmatched throw new AssertionFailure("cannot use a formula-based element in the where condition"); |
2 | Unmatched throw new NullPointerException("null key for collection: " + role); |
3 | Expression getKeyType().nullSafeSet(st,key,i,session) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression getKeyType().nullSafeSet(st,key,i,session) is a void method call, and thus it cannot be parameterized |
5 | Expression getElementType().nullSafeSet(st,elt,i,elementColumnIsInPrimaryKey,session) is a void method call, and thus it cannot be parameterized |