if ( value != null ) { //values is not null and is checkable, we'll look deeper String breakProperties = checkSubElementsNullability( propertyTypes[i], value ); if ( breakProperties != null ) { throw new PropertyValueException( "not-null property references a null or transient value", persister.getEntityName(), buildPropertyPath( persister.getPropertyNames()[i], breakProperties ) ); } }
if ( subvalue != null ) { String breakProperties = checkSubElementsNullability( propertyTypes[i], subvalue ); if ( breakProperties != null ) { return buildPropertyPath( compType.getPropertyNames()[i], breakProperties ); } }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/Nullability.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/Nullability.java
Method name: void checkNullability(Object[], EntityPersister, boolean) Method name: String checkComponentNullability(Object, AbstractComponentType)
Number of AST nodes: 4 Number of AST nodes: 4
1
if ( value != null ) {
1
if ( subvalue != null ) {
2
					
2
					
3
					//values is not null and is checkable, we'll look deeper
4
					String breakProperties = checkSubElementsNullability( propertyTypes[i], value );
3
String breakProperties = checkSubElementsNullability( propertyTypes[i], subvalue );
5
					if ( breakProperties != null ) {
4
					if ( breakProperties != null ) {
6
						throw new PropertyValueException(
5
						
7
							"not-null property references a null or transient value",
8
							persister.getEntityName(),
9
							buildPropertyPath( persister.getPropertyNames()[i], breakProperties )
6
return buildPropertyPath( compType.getPropertyNames()[i], breakProperties 
10
						);
7
);
11
					}
8
					}
12
					
9
	
13
				}
10
 			}
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 declared in the same class
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    9
    else if (value != null)
    9
    else if (value != null)
    9
    else if (subvalue != null)
    Differences
    Expression1Expression2Difference
    valuesubvalueVARIABLE_NAME_MISMATCH
    9
    else if (subvalue != null)
    10
    String breakProperties = checkSubElementsNullability(propertyTypes[i], value);
    10
    String breakProperties = checkSubElementsNullability(propertyTypes[i], value);
    10
    String breakProperties = checkSubElementsNullability(propertyTypes[i], subvalue);
    Differences
    Expression1Expression2Difference
    valuesubvalueVARIABLE_NAME_MISMATCH
    10
    String breakProperties = checkSubElementsNullability(propertyTypes[i], subvalue);
    11
    if (breakProperties != null)
    11
    if (breakProperties != null)
                                                                                                                                                              
    12
    return buildPropertyPath(compType.getPropertyNames()[i], breakProperties);
    Preondition Violations
    Unmatched statement return buildPropertyPath(compType.getPropertyNames()[i],breakProperties); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched return buildPropertyPath(compType.getPropertyNames()[i],breakProperties);
    12
    return buildPropertyPath(compType.getPropertyNames()[i], breakProperties);
    12
    throw new PropertyValueException("not-null property references a null or transient value", persister.getEntityName(), buildPropertyPath(persister.getPropertyNames()[i], breakProperties));
    12
    throw new PropertyValueException("not-null property references a null or transient value", persister.getEntityName(), buildPropertyPath(persister.getPropertyNames()[i], breakProperties));
    Preondition Violations
    Unmatched statement throw new PropertyValueException("not-null property references a null or transient value",persister.getEntityName(),buildPropertyPath(persister.getPropertyNames()[i],breakProperties)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched throw new PropertyValueException("not-null property references a null or transient value",persister.getEntityName(),buildPropertyPath(persister.getPropertyNames()[i],breakProperties));
                                                                                                                                                                                                                                                                                                                                                                                            
    Precondition Violations (4)
    Row Violation
    1Unmatched statement return buildPropertyPath(compType.getPropertyNames()[i],breakProperties); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched return buildPropertyPath(compType.getPropertyNames()[i],breakProperties);
    3Unmatched statement throw new PropertyValueException("not-null property references a null or transient value",persister.getEntityName(),buildPropertyPath(persister.getPropertyNames()[i],breakProperties)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched throw new PropertyValueException("not-null property references a null or transient value",persister.getEntityName(),buildPropertyPath(persister.getPropertyNames()[i],breakProperties));