if ( persisterNode != null ) {
try {
collection.setCollectionPersisterClass( ReflectHelper.classForName( persisterNode
.getValue() ) );
}
catch (ClassNotFoundException cnfe) {
throw new MappingException( "Could not find collection persister class: "
+ persisterNode.getValue() );
}
}
if ( persisterNode != null ) {
try {
entity.setEntityPersisterClass( ReflectHelper.classForName( persisterNode
.getValue() ) );
}
catch (ClassNotFoundException cnfe) {
throw new MappingException( "Could not find persister class: "
+ persisterNode.getValue() );
}
}
Clone fragments detected by clone detection tool
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: void bindCollection(Element, Collection, String, String, Mappings, java.util.Map)
|
|
Method name: void bindPersistentClassCommonValues(Element, PersistentClass, Mappings, java.util.Map)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | if ( persisterNode != null ) {↵ | | 1 | if ( persisterNode != null ) {↵
|
2 | try {↵ | | 2 | try {↵
|
3 | collection.setCollectionPersisterClass( ReflectHelper.classForName( persisterNode↵ | | 3 | entity.setEntityPersisterClass( ReflectHelper.classForName( persisterNode↵
|
4 | .getValue() ) );↵ | | 4 | .getValue() ) );↵
|
5 | }↵ | | 5 | }↵
|
6 | catch (ClassNotFoundException cnfe) {↵ | | 6 | catch (ClassNotFoundException cnfe) {↵
|
7 | throw new MappingException( "Could not find collection persister class: "↵ | | 7 | throw new MappingException( "Could not find persister class: "↵
|
8 | + persisterNode.getValue() );↵ | | 8 | + persisterNode.getValue() );↵
|
9 | }↵ | | 9 | }↵
|
10 | } | | 10 | }
|
See real code fragment |
|
See real code fragment |
Summary
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 declared in the same class |
Number of node comparisons | 5 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.8 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
28 | if (persisterNode != null) | | 20 | if (persisterNode != null) |
29 | | | 21 | |
| | | 22 | entity.setEntityPersisterClass(ReflectHelper.classForName(persisterNode.getValue())); |
30 | collection.setCollectionPersisterClass(ReflectHelper.classForName(persisterNode.getValue())); | | | |
Precondition Violations (4)
Row |
Violation |
1 | Unmatched statement entity.setEntityPersisterClass(ReflectHelper.classForName(persisterNode.getValue())); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement entity.setEntityPersisterClass(ReflectHelper.classForName(persisterNode.getValue())); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
3 | Unmatched statement collection.setCollectionPersisterClass(ReflectHelper.classForName(persisterNode.getValue())); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Unmatched statement collection.setCollectionPersisterClass(ReflectHelper.classForName(persisterNode.getValue())); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |