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: 7 | Number of AST nodes: 7 | |||
1 | this.nodeName = mappingInfo.getNodeName();↵ | 1 | this.entityName = mappingInfo.getEntityName();↵ | |
2 | isInstanceNodeNames.add( nodeName );↵ | 2 | isInstanceEntityNames.add( entityName );↵ | |
3 | if ( mappingInfo.hasSubclasses() ) {↵ | 3 | if ( mappingInfo.hasSubclasses() ) {↵ | |
4 | Iterator itr = mappingInfo.getSubclassClosureIterator();↵ | 4 | Iterator itr = mappingInfo.getSubclassClosureIterator();↵ | |
5 | while ( itr.hasNext() ) {↵ | 5 | while ( itr.hasNext() ) {↵ | |
6 | final PersistentClass subclassInfo = ( PersistentClass ) itr.next();↵ | 6 | final PersistentClass subclassInfo = ( PersistentClass ) itr.next();↵ | |
7 | isInstanceNodeNames.add( subclassInfo.getNodeName() );↵ | 7 | isInstanceEntityNames.add( subclassInfo.getEntityName() );↵ | |
8 | }↵ | 8 | }↵ | |
9 | } | 9 |
| |
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 | 15 |
Number of mapped statements | 6 |
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) | 1.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | this.nodeName = mappingInfo.getNodeName(); |
| 1 | this.entityName = mappingInfo.getEntityName(); | |||||||||||||||||||
2 | isInstanceNodeNames.add(nodeName); |
| 2 | isInstanceEntityNames.add(entityName); | |||||||||||||||||||
3 | if (mappingInfo.hasSubclasses()) | 3 | if (mappingInfo.hasSubclasses()) | ||||||||||||||||||||
4 | Iterator itr = mappingInfo.getSubclassClosureIterator(); | 4 | Iterator itr = mappingInfo.getSubclassClosureIterator(); | ||||||||||||||||||||
5 | while (itr.hasNext()) | 5 | while (itr.hasNext()) | ||||||||||||||||||||
6 | final PersistentClass subclassInfo = (PersistentClass)itr.next(); | 6 | final PersistentClass subclassInfo = (PersistentClass)itr.next(); | ||||||||||||||||||||
|
| 7 | isInstanceEntityNames.add(subclassInfo.getEntityName()); | ||||||||||||||||||||
7 | isInstanceNodeNames.add(subclassInfo.getNodeName()); |
| |
Row | Violation |
---|---|
1 | Expression this.nodeName is a field being modified, and thus it cannot be parameterized |
2 | Expression this.entityName is a field being modified, and thus it cannot be parameterized |
3 | Expression nodeName cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression entityName cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Type java.util.HashSet of variable isInstanceNodeNames does not match with type java.util.Set of variable isInstanceEntityNames |
6 | Unmatched statement isInstanceEntityNames.add(subclassInfo.getEntityName()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Unmatched statement isInstanceNodeNames.add(subclassInfo.getNodeName()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |