for ( int i=0; i<types.length; i++ ) { Object result = processValue( values[i], types[i] ); if (result!=null) { values[i] = result; substituteComponent = true; } }
for ( int i = 0; i < propertySpan; i++ ) { Object y = values[i]; result *= 37; if ( y != null ) { result += propertyTypes[i].getHashCode( y, entityMode, factory ); } }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/event/def/WrapVisitor.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/type/ComponentType.java
Method name: Object processComponent(Object, AbstractComponentType) Method name: int getHashCode(Object, EntityMode, SessionFactoryImplementor)
Number of AST nodes: 5 Number of AST nodes: 5
1
for ( int i=0; i<types.length; i++ ) {
1
for ( int i = 0; i < propertySpan; i++ ) {
2
				Object result = processValue( values[i], types[i] )
2
			Object y = values[i];
3
;
3
			result *= 37;
4
				if (result!=null) {
4
			if ( y != null ) {
5
					values[i] = result;
5
				
6
					substituteComponent = true;
6
result += propertyTypes[i].getHashCode( y, entityMode, factory );
7
				}
7
			}
8
			}
8
		}
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 comparisons12
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    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 3
    Mapped Statements
    ID Statement ID Statement
    5
    for (int i = 0; i < types.length; i++)
    5
    for (int i = 0; i < types.length; i++)
    3
    for (int i = 0; i < propertySpan; i++)
    Differences
    Expression1Expression2Difference
    types.lengthpropertySpanTYPE_COMPATIBLE_REPLACEMENT
    3
    for (int i = 0; i < propertySpan; i++)
    6
    Object result = processValue(values[i], types[i]);
    6
    Object result = processValue(values[i], types[i]);
    4
    Object y = values[i];
    Differences
    Expression1Expression2Difference
    resultyVARIABLE_NAME_MISMATCH
    processValue(values[i],types[i])values[i]TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression processValue(values[i],types[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression values[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    Object y = values[i];
                                
    5
    result *= 37;
    Preondition Violations
    Unmatched statement result*=37; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    result *= 37;
    7
    if (result != null)
    7
    if (result != null)
    6
    if (y != null)
    Differences
    Expression1Expression2Difference
    resultyVARIABLE_NAME_MISMATCH
    6
    if (y != null)
                                                                                                                                
    7
    result += propertyTypes[i].getHashCode(y, entityMode, factory);
    Preondition Violations
    Unmatched statement result+=propertyTypes[i].getHashCode(y,entityMode,factory); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7
    result += propertyTypes[i].getHashCode(y, entityMode, factory);
    8
    values[i] = result;
    8
    values[i] = result;
    Preondition Violations
    Unmatched statement values[i]=result; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                            
    9
    substituteComponent = true;
    9
    substituteComponent = true;
    Preondition Violations
    Unmatched statement substituteComponent=true; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                            
    Precondition Violations (7)
    Row Violation
    1Expression processValue(values[i],types[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression values[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Unmatched statement result*=37; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement result+=propertyTypes[i].getHashCode(y,entityMode,factory); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement values[i]=result; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched statement substituteComponent=true; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7Clone fragment #1 returns variables i, result , while Clone fragment #2 returns variables i, y