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 | } | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 10 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9 | else if (value != null) |
| 9 | else if (subvalue != null) | ||||||||||
10 | String breakProperties = checkSubElementsNullability(propertyTypes[i], value); |
| 10 | String breakProperties = checkSubElementsNullability(propertyTypes[i], subvalue); | ||||||||||
11 | if (breakProperties != null) | 11 | if (breakProperties != null) | |||||||||||
|
| 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)); |
| |
Row | Violation |
---|---|
1 | 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 |
2 | Unmatched return buildPropertyPath(compType.getPropertyNames()[i],breakProperties); |
3 | 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 |
4 | Unmatched throw new PropertyValueException("not-null property references a null or transient value",persister.getEntityName(),buildPropertyPath(persister.getPropertyNames()[i],breakProperties)); |