File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/loader/entity/CollectionElementLoader.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/loader/entity/AbstractEntityLoader.java | |||
Method name: Object loadElement(SessionImplementor, Object, Object)
|
Method name: Object load(SessionImplementor, Object, Object, Serializable)
|
|||
Number of AST nodes: 3 | Number of AST nodes: 3 | |||
1 | if ( getCollectionOwners()!=null ) {↵ | 1 | if ( getCollectionOwners()!=null ) {↵ | |
2 | return list.get(0);↵ | 2 | return list.get(0);↵ | |
3 | }↵ | 3 | }↵ | |
4 | else {↵ | 4 | else {↵ | |
5 | throw new HibernateException(↵ | 5 | throw new HibernateException(↵ | |
6 | "More than one row was found"↵ | 6 | "More than one row with the given identifier was found: " +↵ | |
7 | id +↵ | |||
8 | ", for class: " +↵ | |||
9 | persister.getEntityName()↵ | |||
7 | );↵ | 10 | );↵ | |
8 | } | 11 |
| |
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.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 12 |
Number of mapped statements | 3 |
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) | 0.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6 | if (getCollectionOwners() != null) | 6 | if (getCollectionOwners() != null) | |||||||||||
7 | return list.get(0); | 7 | return list.get(0); | |||||||||||
else | else | |||||||||||||
8 | throw new HibernateException("More than one row was found"); |
| 8 | throw new HibernateException("More than one row with the given identifier was found: " + id + ", for class: " + persister.getEntityName()); |
Row | Violation |
---|