if ( runtimeProperty.isUpdateGenerated() ) { return ValueInclusion.FULL; } else if ( mappingProperty.getValue() instanceof Component ) { if ( hasPartialUpdateComponentGeneration( ( Component ) mappingProperty.getValue() ) ) { return ValueInclusion.PARTIAL; } } return ValueInclusion.NONE;
if ( runtimeProperty.isInsertGenerated() ) { return ValueInclusion.FULL; } else if ( mappingProperty.getValue() instanceof Component ) { if ( hasPartialInsertComponentGeneration( ( Component ) mappingProperty.getValue() ) ) { return ValueInclusion.PARTIAL; } } return ValueInclusion.NONE;
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/tuple/entity/EntityMetamodel.java
Method name: ValueInclusion determineUpdateValueGenerationType(Property, StandardProperty) Method name: ValueInclusion determineInsertValueGenerationType(Property, StandardProperty)
Number of AST nodes: 6 Number of AST nodes: 6
1
if ( runtimeProperty.isUpdateGenerated() ) {
1
if ( runtimeProperty.isInsertGenerated() ) {
2
			return ValueInclusion.FULL;
2
			return ValueInclusion.FULL;
3
		}
3
		}
4
		else if ( mappingProperty.getValue() instanceof Component ) {
4
		else if ( mappingProperty.getValue() instanceof Component ) {
5
			if ( hasPartialUpdateComponentGeneration( ( Component ) mappingProperty.getValue() ) ) {
5
			if ( hasPartialInsertComponentGeneration( ( Component ) mappingProperty.getValue() ) ) {
6
				return ValueInclusion.PARTIAL;
6
				return ValueInclusion.PARTIAL;
7
			}
7
			}
8
		}
8
		}
9
		return ValueInclusion.NONE;
9
		return ValueInclusion.NONE;
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.4
Clones locationClones are declared in the same class
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (runtimeProperty.isUpdateGenerated())
    1
    if (runtimeProperty.isUpdateGenerated())
    1
    if (runtimeProperty.isInsertGenerated())
    Differences
    Expression1Expression2Difference
    isUpdateGeneratedisInsertGeneratedMETHOD_INVOCATION_NAME_MISMATCH
    1
    if (runtimeProperty.isInsertGenerated())
    2
    return ValueInclusion.FULL;
    2
    return ValueInclusion.FULL;
    3
    else if (mappingProperty.getValue() instanceof Component)
    3
    else if (mappingProperty.getValue() instanceof Component)
    4
    if (hasPartialUpdateComponentGeneration((Component)mappingProperty.getValue()))
    4
    if (hasPartialUpdateComponentGeneration((Component)mappingProperty.getValue()))
    4
    if (hasPartialInsertComponentGeneration((Component)mappingProperty.getValue()))
    Differences
    Expression1Expression2Difference
    hasPartialUpdateComponentGenerationhasPartialInsertComponentGenerationMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression hasPartialUpdateComponentGeneration((Component)mappingProperty.getValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method hasPartialUpdateComponentGeneration
    Expression hasPartialInsertComponentGeneration((Component)mappingProperty.getValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method hasPartialInsertComponentGeneration
    4
    if (hasPartialInsertComponentGeneration((Component)mappingProperty.getValue()))
    5
    return ValueInclusion.PARTIAL;
    5
    return ValueInclusion.PARTIAL;
    6
    return ValueInclusion.NONE;
    6
    return ValueInclusion.NONE;
    Precondition Violations (2)
    Row Violation
    1Expression hasPartialUpdateComponentGeneration((Component)mappingProperty.getValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression hasPartialInsertComponentGeneration((Component)mappingProperty.getValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted