File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cfg/HbmBinder.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cfg/HbmBinder.java | |||
Method name: Property createProperty(Value, String, String, Element, Mappings, java.util.Map)
|
Method name: Property createProperty(Value, String, String, Element, Mappings, java.util.Map)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 5 | |||
1 | ToOne toOne = (ToOne↵ | 1 | if ( value instanceof Collection ) {↵ | |
2 | ) value;↵ | 2 | Collection coll = (Collection) value;↵ | |
3 | String propertyRef = toOne.getReferencedPropertyName();↵ | 3 | String propertyRef = coll.getReferencedPropertyName();↵ | |
4 | ↵ | 4 | // not necessarily a *unique* property reference↵ | |
5 | if ( propertyRef != null ) {↵ | 5 | if ( propertyRef != null ) {↵ | |
6 | mappings.addUniquePropertyReference( toOne.getReferencedEntityName(), propertyRef );↵ | 6 | mappings.addPropertyReference( coll.getOwnerEntityName(), propertyRef );↵ | |
7 | } | 7 | }↵ | |
8 |
| |||
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.2 |
Clones location | Clones are in the same method |
Number of node comparisons | 9 |
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) | 0.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5 | ToOne toOne = (ToOne)value; | | ||||||||||||||||
| 10 | Collection coll = (Collection)value; | ||||||||||||||||
6 | String propertyRef = toOne.getReferencedPropertyName(); |
| 11 | String propertyRef = coll.getReferencedPropertyName(); | ||||||||||||||
7 | if (propertyRef != null) | 12 | if (propertyRef != null) | |||||||||||||||
8 | mappings.addUniquePropertyReference(toOne.getReferencedEntityName(), propertyRef); |
| | |||||||||||||||
|
| 13 | mappings.addPropertyReference(coll.getOwnerEntityName(), propertyRef); |
Row | Violation |
---|---|
1 | Type org.hibernate.mapping.ToOne of variable toOne does not match with type org.hibernate.mapping.Collection of variable coll |
2 | Unmatched statement mappings.addUniquePropertyReference(toOne.getReferencedEntityName(),propertyRef); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched statement mappings.addPropertyReference(coll.getOwnerEntityName(),propertyRef); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |