if ( mappingInfo.hasSubclasses() ) {
Iterator itr = mappingInfo.getSubclassClosureIterator();
while ( itr.hasNext() ) {
final PersistentClass subclassInfo = ( PersistentClass ) itr.next();
isInstanceNodeNames.add( subclassInfo.getNodeName() );
}
}
if ( affectedCollectionRoles != null ) {
Iterator itr = affectedCollectionRoles.iterator();
while ( itr.hasNext() ) {
final String roleName = ( String ) itr.next();
session.getFactory().evictCollection( roleName );
}
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/tuple/Dom4jInstantiator.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/action/BulkOperationCleanupAction.java
|
Method name: void Dom4jInstantiator(PersistentClass)
|
|
Method name: void evictCollectionRegions()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if ( mappingInfo.hasSubclasses() ) {↵ | | 1 | if ( ↵
|
2 | Iterator itr = mappingInfo.getSubclassClosureI↵ | | 2 | affectedCollectionRoles != null ) {↵
|
3 | terator();↵ | | 3 | Iterator itr = affectedCollectionRoles.iterator();↵
|
4 | while ( itr.hasNext() ) {↵ | | 4 | while ( itr.hasNext() ) {↵
|
5 | final PersistentClass subclassInfo = ( PersistentClass ) itr.next();↵ | | 5 | final ↵
|
6 | isInstanceNodeNames.add( subclassInfo.getNod↵ | | 6 | String roleName = ( String ) itr.next();↵
|
7 | eName() );↵ | | 7 | session.getFactory().evictCollection( roleName );↵
|
8 | }↵ | | 8 | }↵
|
9 | } | | 9 | }
|
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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 11 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 0.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
| | | 2 | Iterator itr = affectedCollectionRoles.iterator(); |
4 | Iterator itr = mappingInfo.getSubclassClosureIterator(); | | | |
5 | while (itr.hasNext()) | | 3 | while (itr.hasNext()) |
| | | 4 | final String roleName = (String)itr.next(); |
| | | 5 | session.getFactory().evictCollection(roleName); |
6 | final PersistentClass subclassInfo = (PersistentClass)itr.next(); | | | |
7 | isInstanceNodeNames.add(subclassInfo.getNodeName()); | | | |
Precondition Violations (2)
Row |
Violation |
1 | Unmatched statement final String roleName=(String)itr.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement final PersistentClass subclassInfo=(PersistentClass)itr.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |