if ( mappingInfo.hasSubclasses() ) {
Iterator itr = mappingInfo.getSubclassClosureIterator();
while ( itr.hasNext() ) {
final PersistentClass subclassInfo = ( PersistentClass ) itr.next();
isInstanceNodeNames.add( subclassInfo.getNodeName() );
}
}
if ( mappingInfo.hasSubclasses() ) {
Iterator itr = mappingInfo.getSubclassClosureIterator();
while ( itr.hasNext() ) {
final PersistentClass subclassInfo = ( PersistentClass ) itr.next();
isInstanceEntityNames.add( subclassInfo.getEntityName() );
}
}
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/tuple/DynamicMapInstantiator.java
|
Method name: void Dom4jInstantiator(PersistentClass)
|
|
Method name: void DynamicMapInstantiator(PersistentClass)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if ( mappingInfo.hasSubclasses() ) {↵ | | 1 | if ( mappingInfo.hasSubclasses() ) {↵
|
2 | Iterator itr = mappingInfo.getSubclassClosureIterator();↵ | | 2 | Iterator itr = mappingInfo.getSubclassClosureIterator();↵
|
3 | while ( itr.hasNext() ) {↵ | | 3 | while ( itr.hasNext() ) {↵
|
4 | final PersistentClass subclassInfo = ( PersistentClass ) itr.next();↵ | | 4 | final PersistentClass subclassInfo = ( PersistentClass ) itr.next();↵
|
5 | isInstanceNodeNames.add( subclassInfo.getNodeName() );↵ | | 5 | isInstanceEntityNames.add( subclassInfo.getEntityName() );↵
|
6 | }↵ | | 6 | }↵
|
7 | } | | 7 | }
|
See real code fragment |
|
See real code fragment |
Summary
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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 13 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
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) | 20.4 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
3 | if (mappingInfo.hasSubclasses()) | | 3 | if (mappingInfo.hasSubclasses()) |
4 | Iterator itr = mappingInfo.getSubclassClosureIterator(); | | 4 | Iterator itr = mappingInfo.getSubclassClosureIterator(); |
5 | | | 5 | |
6 | final PersistentClass subclassInfo = (PersistentClass)itr.next(); | | 6 | final PersistentClass subclassInfo = (PersistentClass)itr.next(); |
7 | isInstanceNodeNames.add(subclassInfo.getNodeName()); | | 7 | isInstanceEntityNames.add(subclassInfo.getEntityName()); |
Precondition Violations (2)
Row |
Violation |
1 | Expression subclassInfo.getNodeName() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression subclassInfo.getEntityName() cannot be parameterized, because it has dependencies to/from statements that will be extracted |