if ( !implicitJoin ) { EntityPersister entityPersister = elem.getEntityPersister(); if ( entityPersister != null ) { getWalker().addQuerySpaces( entityPersister.getQuerySpaces() ); } }
while ( iter.hasNext() ) { Object compValue = iter.next(); if (compValue != null) { return checkComponentNullability(compValue, componentType); } }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/hql/ast/tree/DotNode.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/Nullability.java
Method name: void dereferenceCollection(CollectionType, boolean, boolean, String, AST) Method name: String checkSubElementsNullability(Type, Object)
Number of AST nodes: 4 Number of AST nodes: 4
1
if ( !implicitJoin ) {
2
			EntityPersister entityPersister = elem.getEntityPersister
1
while ( iter.hasNext() ) {
3
();
2
					Object compValue = iter.next();
4
			if ( entityPersister != null ) {
3
					if (compValue != null) {
5
				getWalker().addQuerySpaces( entityPersister.getQuerySpaces() );
4
						return checkComponentNullability(compValue, componentType);
6
			}
5
					}
7
		}
6
				}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in different classes
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                      
    10
    Object compValue = iter.next();
    Preondition Violations
    Unmatched statement Object compValue=iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    10
    Object compValue = iter.next();
    22
    EntityPersister entityPersister = elem.getEntityPersister();
                                                                                                                                
    23
    if (entityPersister != null)
    23
    if (entityPersister != null)
    11
    if (compValue != null)
    Differences
    Expression1Expression2Difference
    entityPersistercompValueVARIABLE_NAME_MISMATCH
    org.hibernate.persister.entity.EntityPersisterjava.lang.ObjectVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.persister.entity.EntityPersister of variable entityPersister does not match with type java.lang.Object of variable compValue
    • Make classes org.hibernate.persister.entity.EntityPersister and java.lang.Object extend a common superclass
    11
    if (compValue != null)
                                                                                                                                
    12
    return checkComponentNullability(compValue, componentType);
    Preondition Violations
    Unmatched return checkComponentNullability(compValue,componentType);
    12
    return checkComponentNullability(compValue, componentType);
    24
    getWalker().addQuerySpaces(entityPersister.getQuerySpaces());
                                                                                                                                      
    Precondition Violations (3)
    Row Violation
    1Unmatched statement Object compValue=iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Type org.hibernate.persister.entity.EntityPersister of variable entityPersister does not match with type java.lang.Object of variable compValue
    3Unmatched return checkComponentNullability(compValue,componentType);