super.validate(mapping); if ( !getIdentifier().isValid(mapping) ) { throw new MappingException( "collection id mapping has wrong number of columns: " + getRole() + " type: " + getIdentifier().getType().getName() ); }
super.validate(mapping); if ( !getIdentifier().isValid(mapping) ) { throw new MappingException( "identifier mapping has wrong number of columns: " + getEntityName() + " type: " + getIdentifier().getType().getName() ); } checkCompositeIdentifier();
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/mapping/IdentifierCollection.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/mapping/RootClass.java
Method name: void validate(Mapping) Method name: void validate(Mapping)
Number of AST nodes: 3 Number of AST nodes: 4
1
super.validate(mapping);
1
super.validate(mapping);
2
		if ( !getIdentifier().isValid(mapping) ) {
2
		if ( !getIdentifier().isValid(mapping) ) {
3
			throw new MappingException(
3
			throw new MappingException(
4
				"collection id mapping has wrong number of columns: " +
4
				"identifier mapping has wrong number of columns: " +
5
				getRole() +
5
				getEntityName() +
6
				" type: " +
6
				" type: " +
7
				getIdentifier().getType().getName()
7
				getIdentifier().getType().getName()
8
			);
8
			);
9
		}
9
		}
10
		checkCompositeIdentifier();
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.2
Clones locationClones are in different classes
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)32.9
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    super.validate(mapping);
    1
    super.validate(mapping);
    1
    super.validate(mapping);
    Preondition Violations
    Super method call super.validate(mapping); cannot be extracted from method
    Super method call super.validate(mapping); cannot be extracted from method
    1
    super.validate(mapping);
    2
    if (!getIdentifier().isValid(mapping))
    2
    if (!getIdentifier().isValid(mapping))
    3
    throw new MappingException("collection id mapping has wrong number of columns: " + getRole() + " type: " + getIdentifier().getType().getName());
    3
    throw new MappingException("collection id mapping has wrong number of columns: " + getRole() + " type: " + getIdentifier().getType().getName());
    3
    throw new MappingException("identifier mapping has wrong number of columns: " + getEntityName() + " type: " + getIdentifier().getType().getName());
    Differences
    Expression1Expression2Difference
    "collection id mapping has wrong number of columns: ""identifier mapping has wrong number of columns: "LITERAL_VALUE_MISMATCH
    getRolegetEntityNameMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression getRole() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression getEntityName() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    3
    throw new MappingException("identifier mapping has wrong number of columns: " + getEntityName() + " type: " + getIdentifier().getType().getName());
                                                                
    4
    checkCompositeIdentifier();
    Precondition Violations (5)
    Row Violation
    1Super method call super.validate(mapping); cannot be extracted from method
    2Super method call super.validate(mapping); cannot be extracted from method
    3Expression getRole() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    4Expression getEntityName() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    5The refactoring of the clones is infeasible, because classes org.hibernate.mapping.IdentifierCollection and org.hibernate.mapping.RootClass do not have a common superclass