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: Method getterMethod(Class, String)
|
Method name: Method getterMethod(Class, String)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | if ( methodName.startsWith("get") ) {↵ | 1 | if ( methodName.startsWith("is") ) {↵ | |
2 | String testStdMethod = Introspector.decapitalize( methodName.substring(3) );↵ | 2 | String testStdMethod = Introspector.decapitalize( methodName.substring(2) );↵ | |
3 | String testOldMethod = methodName.substring(3);↵ | 3 | String testOldMethod = methodName.substring(2);↵ | |
4 | if ( testStdMethod.equals(propertyName) || testOldMethod.equals(propertyName) ) {↵ | 4 | if ( testStdMethod.equals(propertyName) || testOldMethod.equals(propertyName) ) {↵ | |
5 | return methods[i];↵ | 5 | return methods[i];↵ | |
6 | }↵ | 6 | }↵ | |
7 | } | 7 |
| |
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.4 |
Clones location | Clones are in the same method |
Number of node comparisons | 15 |
Number of mapped statements | 5 |
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) | 2.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5 | if (methodName.startsWith("get")) |
| 10 | if (methodName.startsWith("is")) | ||||||||||
6 | String testStdMethod = Introspector.decapitalize(methodName.substring(3)); |
| 11 | String testStdMethod = Introspector.decapitalize(methodName.substring(2)); | ||||||||||
7 | String testOldMethod = methodName.substring(3); |
| 12 | String testOldMethod = methodName.substring(2); | ||||||||||
8 | if (testStdMethod.equals(propertyName) || testOldMethod.equals(propertyName)) | 13 | if (testStdMethod.equals(propertyName) || testOldMethod.equals(propertyName)) | |||||||||||
9 | return methods[i]; | 14 | return methods[i]; |
Row | Violation |
---|---|
1 | Not all possible execution flows end in a return statement |