if ( prop.getValue() instanceof Component ) { if ( hasPartialUpdateComponentGeneration( ( Component ) prop.getValue() ) ) { return true; } }
for ( int i = 0; i < types.length; i++ ) { if ( !areCompatible( types[i], selectTypes[i] ) ) { throw new QueryException( "insertion type [" + types[i] + "] and selection type [" + selectTypes[i] + "] at position " + i + " are not compatible" ); } }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/tuple/entity/EntityMetamodel.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/hql/ast/tree/IntoClause.java
Method name: boolean hasPartialUpdateComponentGeneration(Component) Method name: void validateTypes(SelectClause)
Number of AST nodes: 3 Number of AST nodes: 3
1
if ( prop.getValue() instanceof Component ) {
1
for ( int i = 0; i < types.length; i++ ) {
2
	
3
			if ( hasPartialUpdateComponentGeneration( ( Component ) prop.getValue() ) ) {
2
			if ( 
4
					return true;
5
	
3
!areCompatible( types[i], selectTypes[i] ) ) {
4
				throw new QueryException(
5
				        "insertion type [" + types[i] + "] and selection type [" +
6
				        selectTypes[i] + "] at position " + i + " are not compatible"
7
				);
6
			}
8
			}
7
	
8
		}
9
		}
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 comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)8.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    7
    if (hasPartialUpdateComponentGeneration((Component)prop.getValue()))
    7
    if (hasPartialUpdateComponentGeneration((Component)prop.getValue()))
    5
    if (!areCompatible(types[i], selectTypes[i]))
    Differences
    Expression1Expression2Difference
    hasPartialUpdateComponentGeneration((Component)prop.getValue())!areCompatible(types[i],selectTypes[i])TYPE_COMPATIBLE_REPLACEMENT
    5
    if (!areCompatible(types[i], selectTypes[i]))
                                                                                                                                                                                                                                                                                                        
    6
    throw new QueryException("insertion type [" + types[i] + "] and selection type [" + selectTypes[i] + "] at position " + i + " are not compatible");
    Preondition Violations
    Unmatched throw new QueryException("insertion type [" + types[i] + "] and selection type ["+ selectTypes[i]+ "] at position "+ i+ " are not compatible");
    6
    throw new QueryException("insertion type [" + types[i] + "] and selection type [" + selectTypes[i] + "] at position " + i + " are not compatible");
    8
    return true;
    8
    return true;
    Preondition Violations
    Unmatched return true;
                                  
    Precondition Violations (2)
    Row Violation
    1Unmatched throw new QueryException("insertion type [" + types[i] + "] and selection type ["+ selectTypes[i]+ "] at position "+ i+ " are not compatible");
    2Unmatched return true;