File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/loader/Loader.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/loader/Loader.java | |||
Method name: void initializeEntitiesAndCollections(List, Object, SessionImplementor, boolean)
|
Method name: void initializeEntitiesAndCollections(List, Object, SessionImplementor, boolean)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | if ( collectionPersisters != null ) {↵ | 1 | if ( collectionPersisters != null ) {↵ | |
2 | for ( int i=0; i<collectionPersisters.length; i++ ) {↵ | 2 | for ( int i=0; i<collectionPersisters.length; i++ ) {↵ | |
3 | if ( collectionPersisters[i].isArray() ) {↵ | 3 | if ( !collectionPersisters[i].isArray() ) {↵ | |
4 | //for arrays, we should end the collection load before resolving↵ | 4 | //for sets, we should end the collection load after resolving↵ | |
5 | //the entities, since the actual array instances are not instantiated↵ | 5 | //the entities, since ↵ | |
6 | //during loading↵ | 6 | we might call hashCode() on the elements↵ | |
7 | //TODO: or we could do this polymorphically, and have two↵ | 7 | //TODO: or we could do this polymorphically, and have two↵ | |
8 | // different operations implemented differently for arrays↵ | 8 | // different operations implemented differently for arrays↵ | |
9 | endCollectionLoad( resultSetId, session, collectionPersisters[i] );↵ | 9 | endCollectionLoad( resultSetId, session, collectionPersisters[i] );↵ | |
10 | }↵ | 10 | }↵ | |
11 | }↵ | 11 | }↵ | |
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.3 |
Clones location | Clones are in the same method |
Number of node comparisons | 7 |
Number of mapped statements | 4 |
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.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | if (collectionPersisters != null) | 19 | if (collectionPersisters != null) | |||||||||||||
3 | for (int i = 0; i < collectionPersisters.length; i++) | 20 | for (int i = 0; i < collectionPersisters.length; i++) | |||||||||||||
4 | if (collectionPersisters[i].isArray()) |
| 21 | if (!collectionPersisters[i].isArray()) | ||||||||||||
5 | endCollectionLoad(resultSetId, session, collectionPersisters[i]); | 22 | endCollectionLoad(resultSetId, session, collectionPersisters[i]); |
Row | Violation |
---|---|
1 | Expression collectionPersisters[i].isArray() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression !collectionPersisters[i].isArray() cannot be parameterized, because it has dependencies to/from statements that will be extracted |