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: Setter createSetter(Class, String)
|
Method name: Getter createGetter(Class, String)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | BasicSetter result = getSetterOrNull(theClass, propertyName);↵ | 1 | BasicGetter result = getGetterOrNull(theClass, propertyName);↵ | |
2 | if (result==null) {↵ | 2 | if (result==null) {↵ | |
3 | throw new PropertyNotFoundException( ↵ | 3 | throw new PropertyNotFoundException( ↵ | |
4 | "Could not find a setter for property " + ↵ | 4 | "Could not find a getter for " + ↵ | |
5 | propertyName + ↵ | 5 | propertyName + ↵ | |
6 | " in class " + ↵ | 6 | " in class " + ↵ | |
7 | theClass.getName() ↵ | 7 | theClass.getName() ↵ | |
8 | );↵ | 8 | );↵ | |
9 | }↵ | 9 | }↵ | |
10 | return result; | 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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 8 |
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) | 1.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | BasicGetter result = getGetterOrNull(theClass, propertyName); | |||||||||||||
1 | BasicSetter result = getSetterOrNull(theClass, propertyName); | | |||||||||||||
2 | if (result == null) |
| 2 | if (result == null) | |||||||||||
3 | throw new PropertyNotFoundException("Could not find a setter for property " + propertyName + " in class " + theClass.getName()); |
| 3 | throw new PropertyNotFoundException("Could not find a getter for " + propertyName + " in class " + theClass.getName()); | |||||||||||
|
| 4 | return result; | ||||||||||||
4 | return result; |
| |
Row | Violation |
---|---|
1 | Type org.hibernate.property.BasicPropertyAccessor.BasicSetter of variable result does not match with type org.hibernate.property.BasicPropertyAccessor.BasicGetter of variable result |
2 | Unmatched statement return result; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched return result; |
4 | Unmatched statement return result; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
5 | Unmatched return result; |