CollectionPersister result = (CollectionPersister) collectionPersisters.get(role); if (result==null) { throw new MappingException( "Unknown collection role: " + role ); } return result;
NamedParameterDescriptor meta = ( NamedParameterDescriptor ) namedDescriptorMap.get( name ); if ( meta == null ) { throw new QueryParameterException( "could not locate named parameter [" + name + "]" ); } return meta;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/impl/SessionFactoryImpl.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/query/ParameterMetadata.java
Method name: CollectionPersister getCollectionPersister(String) Method name: NamedParameterDescriptor getNamedParameterDescriptor(String)
Number of AST nodes: 4 Number of AST nodes: 4
1
CollectionPersister result = (CollectionPersister) collectionPersisters.get(role);
1
NamedParameterDescriptor meta = ( NamedParameterDescriptor ) namedDescriptorMap.get( name );
2
		if (result==null) {
2
		if ( meta == null ) {
3
			throw new MappingException( "Unknown collection role: " + role );
3
			throw new QueryParameterException( "could not locate named parameter [" + name + "]" );
4
		}
4
		}
5
		return result;
5
		return meta;
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 comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    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.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                                                                    
    1
    NamedParameterDescriptor meta = (NamedParameterDescriptor)namedDescriptorMap.get(name);
    1
    CollectionPersister result = (CollectionPersister)collectionPersisters.get(role);
                                                                                                                                                                        
    2
    if (result == null)
    2
    if (result == null)
    2
    if (meta == null)
    Differences
    Expression1Expression2Difference
    resultmetaVARIABLE_NAME_MISMATCH
    org.hibernate.persister.collection.CollectionPersisterorg.hibernate.engine.query.NamedParameterDescriptorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.persister.collection.CollectionPersister of variable result does not match with type org.hibernate.engine.query.NamedParameterDescriptor of variable meta
    • Make classes org.hibernate.persister.collection.CollectionPersister and org.hibernate.engine.query.NamedParameterDescriptor extend a common superclass
    2
    if (meta == null)
    3
    throw new MappingException("Unknown collection role: " + role);
    3
    throw new MappingException("Unknown collection role: " + role);
    3
    throw new QueryParameterException("could not locate named parameter [" + name + "]");
    Differences
    Expression1Expression2Difference
    org.hibernate.MappingExceptionorg.hibernate.QueryParameterExceptionSUBCLASS_TYPE_MISMATCH
    "Unknown collection role: ""could not locate named parameter ["LITERAL_VALUE_MISMATCH
    rolenameVARIABLE_NAME_MISMATCH
    "Unknown collection role: " + role"could not locate named parameter [" + name + "]"INFIX_EXTENDED_OPERAND_NUMBER_MISMATCH
    3
    throw new QueryParameterException("could not locate named parameter [" + name + "]");
                                  
    4
    return meta;
    Preondition Violations
    Unmatched return meta;
    4
    return meta;
    4
    return result;
    4
    return result;
    Preondition Violations
    Unmatched return result;
                                      
    Precondition Violations (3)
    Row Violation
    1Type org.hibernate.persister.collection.CollectionPersister of variable result does not match with type org.hibernate.engine.query.NamedParameterDescriptor of variable meta
    2Unmatched return meta;
    3Unmatched return result;