File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cfg/Configuration.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cfg/Configuration.java | |||
Method name: Iterator iterateGenerators(Dialect)
|
Method name: Iterator iterateGenerators(Dialect)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | while ( iter.hasNext() ) {↵ | 1 | while ( iter.hasNext() ) {↵ | |
2 | PersistentClass pc = (PersistentClass) iter.next();↵ | 2 | Collection collection = (Collection) iter.next();↵ | |
3 | if ( !pc.isInherited() ) {↵ | 3 | if ( collection.isIdentified() ) {↵ | |
4 | IdentifierGenerator ig = pc.getIdentifier()↵ | 4 | IdentifierGenerator ig = ( (IdentifierCollection) collection ).getIdentifier()↵ | |
5 | .createIdentifierGenerator(↵ | 5 | .createIdentifierGenerator(↵ | |
6 | dialect,↵ | 6 | dialect,↵ | |
7 | defaultCatalog,↵ | 7 | defaultCatalog,↵ | |
8 | defaultSchema,↵ | 8 | defaultSchema,↵ | |
9 | (RootClass) pc↵ | 9 | null↵ | |
10 | );↵ | 10 | );↵ | |
11 | if ( ig instanceof PersistentIdentifierGenerator ) {↵ | 11 | if ( ig instanceof PersistentIdentifierGenerator ) {↵ | |
12 | generators.put( ( (PersistentIdentifierGenerator) ig ).generatorKey(), ig );↵ | 12 | generators.put( ( (PersistentIdentifierGenerator) ig ).generatorKey(), ig );↵ | |
13 | }↵ | 13 | }↵ | |
14 | }↵ | 14 | }↵ | |
15 | } | 15 |
| |
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 the same method |
Number of node comparisons | 12 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 1.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5 | while (iter.hasNext()) | 12 | while (iter.hasNext()) | |||||||||||
6 | PersistentClass pc = (PersistentClass)iter.next(); |
| | |||||||||||
|
| 13 | Collection collection = (Collection)iter.next(); | |||||||||||
7 | if (!pc.isInherited()) |
| 14 | if (collection.isIdentified()) | ||||||||||
8 | IdentifierGenerator ig = pc.getIdentifier().createIdentifierGenerator(dialect, defaultCatalog, defaultSchema, (RootClass)pc); |
| | |||||||||||
|
| 15 | IdentifierGenerator ig = ((IdentifierCollection)collection).getIdentifier().createIdentifierGenerator(dialect, defaultCatalog, defaultSchema, null); | |||||||||||
9 | if (ig instanceof PersistentIdentifierGenerator) | 16 | if (ig instanceof PersistentIdentifierGenerator) | |||||||||||
10 | generators.put(((PersistentIdentifierGenerator)ig).generatorKey(), ig); | 17 | generators.put(((PersistentIdentifierGenerator)ig).generatorKey(), ig); |
Row | Violation |
---|---|
1 | Unmatched statement PersistentClass pc=(PersistentClass)iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement Collection collection=(Collection)iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement IdentifierGenerator ig=pc.getIdentifier().createIdentifierGenerator(dialect,defaultCatalog,defaultSchema,(RootClass)pc); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement IdentifierGenerator ig=((IdentifierCollection)collection).getIdentifier().createIdentifierGenerator(dialect,defaultCatalog,defaultSchema,null); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |