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
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in different classes
Number of node comparisons13
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)20.4
    Clone typeType 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
    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
    isInstanceNodeNames.add(subclassInfo.getNodeName());
    7
    isInstanceEntityNames.add(subclassInfo.getEntityName());
    Differences
    Expression1Expression2Difference
    getNodeNamegetEntityNameMETHOD_INVOCATION_NAME_MISMATCH
    isInstanceNodeNamesisInstanceEntityNamesVARIABLE_NAME_MISMATCH
    java.util.HashSetjava.util.SetSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression subclassInfo.getNodeName() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression subclassInfo.getEntityName() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    isInstanceEntityNames.add(subclassInfo.getEntityName());
    Precondition Violations (2)
    Row Violation
    1Expression subclassInfo.getNodeName() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression subclassInfo.getEntityName() cannot be parameterized, because it has dependencies to/from statements that will be extracted