BasicGetter result = getGetterOrNull(theClass, propertyName);
if (result==null) {
throw new PropertyNotFoundException(
"Could not find a getter for " +
propertyName +
" in class " +
theClass.getName()
);
}
return result;
BasicSetter result = getSetterOrNull(theClass, propertyName);
if (result==null) {
throw new PropertyNotFoundException(
"Could not find a setter for property " +
propertyName +
" in class " +
theClass.getName()
);
}
return result;
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/BasicPropertyAccessor.java
|
Method name: Getter createGetter(Class, String)
|
|
Method name: Setter createSetter(Class, String)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | BasicGetter result = getGetterOrNull(theClass, propertyName);↵ | | 1 | BasicSetter result = getSetterOrNull(theClass, propertyName);↵
|
2 | if (result==null) {↵ | | 2 | if (result==null) {↵
|
3 | throw new PropertyNotFoundException( ↵ | | 3 | throw new PropertyNotFoundException( ↵
|
4 | "Could not find a getter for " + ↵ | | 4 | "Could not find a setter for property " + ↵
|
5 | propertyName + ↵ | | 5 | propertyName + ↵
|
6 | " in class " + ↵ | | 6 | " in class " + ↵
|
7 | theClass.getName() ↵ | | 7 | theClass.getName() ↵
|
8 | );↵ | | 8 | );↵
|
9 | }↵ | | 9 | }↵
|
10 | return result; | | 10 | return result;
|
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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 8 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
| | | 1 | BasicSetter result = getSetterOrNull(theClass, propertyName); |
1 | BasicGetter result = getGetterOrNull(theClass, propertyName); | | | |
2 | if (result == null) | | 2 | if (result == null) |
3 | throw new PropertyNotFoundException("Could not find a getter for " + propertyName + " in class " + theClass.getName()); | | 3 | throw new PropertyNotFoundException("Could not find a setter for property " + propertyName + " in class " + theClass.getName()); |
| | | 4 | return result; |
4 | return result; | | | |
Precondition Violations (3)
Row |
Violation |
1 | Type org.hibernate.property.BasicPropertyAccessor.BasicGetter of variable result does not match with type org.hibernate.property.BasicPropertyAccessor.BasicSetter of variable result |
2 | Unmatched return result; |
3 | Unmatched return result; |