File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/property/ChainedPropertyAccessor.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/property/ChainedPropertyAccessor.java | |||
Method name: Getter getGetter(Class, String)
|
Method name: Setter getSetter(Class, String)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | Getter result = null;↵ | 1 | Setter result = null;↵ | |
2 | for (int i = 0; i < chain.length; i++) {↵ | 2 | for (int i = 0; i < chain.length; i++) {↵ | |
3 | PropertyAccessor candidate = chain[i];↵ | 3 | PropertyAccessor candidate = chain[i];↵ | |
4 | try {↵ | 4 | try {↵ | |
5 | result = candidate.getGetter(theClass, propertyName);↵ | 5 | result = candidate.getSetter(theClass, propertyName);↵ | |
6 | return result;↵ | 6 | return result;↵ | |
7 | } catch (PropertyNotFoundException pnfe) {↵ | 7 | } catch (PropertyNotFoundException pnfe) {↵ | |
8 | // ignore↵ | 8 | //↵ | |
9 | }↵ | 9 | }↵ | |
10 | }↵ | 10 | }↵ | |
11 | throw new PropertyNotFoundException("Could not find getter for " + propertyName + " on " + theClass); | 11 | throw new PropertyNotFoundException("Could not find setter for " + propertyName + " on " + theClass); | |
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 | 17 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 1.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Setter result = null; | ||||||||||||
1 | Getter result = null; | | ||||||||||||
2 | for (int i = 0; i < chain.length; i++) | 2 | for (int i = 0; i < chain.length; i++) | |||||||||||
3 | PropertyAccessor candidate = chain[i]; | 3 | PropertyAccessor candidate = chain[i]; | |||||||||||
4 | try | 4 | try | |||||||||||
|
| 5 | result = candidate.getSetter(theClass, propertyName); | |||||||||||
5 | result = candidate.getGetter(theClass, propertyName); |
| | |||||||||||
|
| 6 | return result; | |||||||||||
6 | return result; |
| | |||||||||||
7 | throw new PropertyNotFoundException("Could not find getter for " + propertyName + " on " + theClass); |
| 7 | throw new PropertyNotFoundException("Could not find setter for " + propertyName + " on " + theClass); |
Row | Violation |
---|---|
1 | Unmatched statement result=candidate.getSetter(theClass,propertyName); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement result=candidate.getSetter(theClass,propertyName); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
3 | Unmatched statement result=candidate.getGetter(theClass,propertyName); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement result=candidate.getGetter(theClass,propertyName); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
5 | Unmatched return result; |
6 | Unmatched return result; |