if ( value==null && method.getParameterTypes()[0].isPrimitive() ) {
throw new PropertyAccessException(
npe,
"Null value was assigned to a property of primitive type",
true,
clazz,
propertyName
);
}
else {
throw new PropertyAccessException(
npe,
"NullPointerException occurred while calling",
true,
clazz,
propertyName
);
}
if(value == null && field.getType().isPrimitive()) {
throw new PropertyAccessException(
e,
"Null value was assigned to a property of primitive type",
true,
clazz,
name
);
} else {
throw new PropertyAccessException(e, "could not set a field value by reflection", true, clazz, name);
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/property/BasicPropertyAccessor.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/property/DirectPropertyAccessor.java
|
Method name: void set(Object, Object, SessionFactoryImplementor)
|
|
Method name: void set(Object, Object, SessionFactoryImplementor)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | if ( value==null && method.getParameterTypes()[0].isPrimitive() ) {↵ | | 1 | if(value == null && field.getType().isPrimitive()) {↵
|
2 | throw new PropertyAccessException(↵ | | 2 | throw new PropertyAccessException(↵
|
3 | npe, ↵ | | 3 | e, ↵
|
4 | "Null value was assigned to a property of primitive type", ↵ | | 4 | "Null value was assigned to a property of primitive type", ↵
|
5 | true, ↵ | | 5 | true, ↵
|
6 | clazz, ↵ | | 6 | clazz, ↵
|
7 | propertyName↵ | | 7 | name↵
|
8 | );↵ | | 8 | );↵
|
9 | }↵ | | 9 | ↵
|
10 | else {↵ | | 10 | } else {↵
|
11 | throw new PropertyAccessException(↵ | | 11 | throw new PropertyAccessException(↵
|
12 | npe, ↵ | | |
|
13 | "NullPointerException occurred while calling", ↵ | | |
|
14 | true, ↵ | | |
|
15 | clazz, ↵ | | |
|
16 | propertyName↵ | | |
|
17 | );↵ | | 12 | e, "could not set a field value by reflection", true, clazz, name);↵
|
18 | } | | 13 | }
|
See real code fragment |
|
See real code fragment |
Summary
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.0 |
Clones location | Clones are in different classes |
Number of node comparisons | 0 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 0 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Unknown type |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
Precondition Violations (0)
Row |
Violation |