File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/persister/entity/UnionSubclassEntityPersister.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/tuple/DynamicMapInstantiator.java | |||
Method name: String generateSubquery(PersistentClass, Mapping)
|
Method name: void DynamicMapInstantiator(PersistentClass)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | Table table = (Table) titer.next();↵ | |||
2 | if ( !table.isAbstractUnionTable() ) {↵ | 1 | if ( mappingInfo.hasSubclasses() ) {↵ | |
3 | Iterator citer = table.getColumnIterator();↵ | 2 | Iterator itr = mappingInfo.getSubclassClosureIterator();↵ | |
4 | while ( citer.hasNext() ) columns.add( citer.next↵ | 3 | while ( itr.hasNext() ) {↵ | |
4 | final PersistentClass subclassInfo = ( PersistentClass ) itr.next();↵ | |||
5 | () );↵ | 5 | isInstanceEntityNames.add( subclassInfo.getEntityName() );↵ | |
6 | } | 6 | }↵ | |
7 |
| |||
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 different classes |
Number of node comparisons | 10 |
Number of mapped statements | 2 |
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) | 34.1 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8 | Table table = (Table)titer.next(); |
| | ||||||||||||
9 | if (!table.isAbstractUnionTable()) |
| 3 | if (mappingInfo.hasSubclasses()) | |||||||||||
|
| 4 | Iterator itr = mappingInfo.getSubclassClosureIterator(); | ||||||||||||
10 | Iterator citer = table.getColumnIterator(); |
| | ||||||||||||
11 | while (citer.hasNext()) |
| 5 | while (itr.hasNext()) | |||||||||||
|
| 6 | final PersistentClass subclassInfo = (PersistentClass)itr.next(); | ||||||||||||
| 7 | isInstanceEntityNames.add(subclassInfo.getEntityName()); | |||||||||||||
12 | columns.add(citer.next()); | |
Row | Violation |
---|---|
1 | Unmatched statement Table table=(Table)titer.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Expression !table.isAbstractUnionTable() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement Iterator itr=mappingInfo.getSubclassClosureIterator(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Unmatched statement Iterator citer=table.getColumnIterator(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | 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 |
6 | The refactoring of the clones is infeasible, because classes org.hibernate.persister.entity.UnionSubclassEntityPersister and org.hibernate.tuple.DynamicMapInstantiator do not have a common superclass |