Iterator itr = files.iterator();
while ( itr.hasNext() ) {
final File file = ( File ) itr.next();
processFile( file, classNames );
}
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/bytecode/buildtime/AbstractInstrumenter.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/tuple/DynamicMapInstantiator.java
|
Method name: void execute(Set)
|
|
Method name: void DynamicMapInstantiator(PersistentClass)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 5
|
|
1 | Iterator itr = files.i↵ | | 1 | if ( mappingInfo.hasSubclasses() ) {↵
|
2 | terator();↵ | | 2 | Iterator itr = mappingInfo.getSubclassClosureIterator();↵
|
3 | while ( itr.hasNext() ) {↵ | | 3 | while ( itr.hasNext() ) {↵
|
4 | final File file = ( File ) itr.next();↵ | | 4 | final ↵
|
5 | processFile( file, class↵ | | 5 | PersistentClass subclassInfo = ( PersistentClass ) itr.next();↵
|
6 | Names );↵ | | 6 | isInstanceEntityNames.add( subclassInfo.getEntityName() );↵
|
7 | } | | 7 | }↵
|
| | | 8 | }
|
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.4 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
| | | 4 | Iterator itr = mappingInfo.getSubclassClosureIterator(); |
12 | while (itr.hasNext()) | | 5 | while (itr.hasNext()) |
| | | 6 | final PersistentClass subclassInfo = (PersistentClass)itr.next(); |
| | | 7 | isInstanceEntityNames.add(subclassInfo.getEntityName()); |
13 | final File file = (File)itr.next(); | | | |
14 | processFile(file, classNames); | | | |
Precondition Violations (2)
Row |
Violation |
1 | 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 |
2 | Unmatched statement final File file=(File)itr.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |