File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/proxy/pojo/cglib/CGLIBLazyInitializer.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/proxy/pojo/javassist/JavassistLazyInitializer.java | |||
Method name: Object invoke(Object, Method, Object[])
|
Method name: Object invoke(Object, Method, Method, Object[])
|
|||
Number of AST nodes: 13 | Number of AST nodes: 13 | |||
1 | if ( result == INVOKE_IMPLEMENTATION ) {↵ | 1 | if ( result == INVOKE_IMPLEMENTATION ) {↵ | |
2 | Object target = getImplementation();↵ | 2 | Object target = getImplementation();↵ | |
3 | try {↵ | 3 | ↵ | |
4 | final Object returnValue;↵ | 4 | final Object returnValue;↵ | |
5 | ↵ | 5 | try {↵ | |
6 | if ( ReflectHelper.isPublic( persistentClass, method ) ) {↵ | 6 | if ( ReflectHelper.isPublic( persistentClass, thisMethod ) ) {↵ | |
7 | if ( !method.getDeclaringClass().isInstance( target ) ) {↵ | 7 | if ( !thisMethod.getDeclaringClass().isInstance( target ) ) {↵ | |
8 | throw new ClassCastException( target.getClass().getName() );↵ | 8 | throw new ClassCastException( target.getClass().getName() );↵ | |
9 | }↵ | 9 | }↵ | |
10 | returnValue = method.invoke( target, args );↵ | 10 | returnValue = thisMethod.invoke( target, args );↵ | |
11 | }↵ | 11 | }↵ | |
12 | else {↵ | 12 | else {↵ | |
13 | if ( !method.isAccessible() ) {↵ | 13 | if ( !thisMethod.isAccessible() ) {↵ | |
14 | method.setAccessible( true );↵ | 14 | thisMethod.setAccessible( true );↵ | |
15 | }↵ | 15 | }↵ | |
16 | returnValue = method.invoke( target, args );↵ | 16 | returnValue = thisMethod.invoke( target, args );↵ | |
17 | }↵ | 17 | }↵ | |
18 | return returnValue == target ? proxy : returnValue;↵ | 18 | return returnValue == target ? proxy : returnValue;↵ | |
19 | }↵ | 19 | }↵ | |
20 | catch ( InvocationTargetException ite ) {↵ | 20 | catch ( InvocationTargetException ite ) {↵ | |
21 | throw ite.getTargetException();↵ | 21 | throw ite.getTargetException();↵ | |
22 | }↵ | 22 | }↵ | |
23 | }↵ | 23 | }↵ | |
24 | else {↵ | 24 | else {↵ | |
25 | return result;↵ | 25 | return result;↵ | |
26 | } | 26 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 1.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 41 |
Number of mapped statements | 12 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 2.3 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | if (result == INVOKE_IMPLEMENTATION) | 5 | if (result == INVOKE_IMPLEMENTATION) | |||||||||||
4 | Object target = getImplementation(); | 6 | Object target = getImplementation(); | |||||||||||
| 7 | final Object returnValue; | ||||||||||||
5 | try | 8 | try | |||||||||||
6 | final Object returnValue; | | ||||||||||||
7 | if (ReflectHelper.isPublic(persistentClass, method)) |
| 9 | if (ReflectHelper.isPublic(persistentClass, thisMethod)) | ||||||||||
8 | if (!method.getDeclaringClass().isInstance(target)) |
| 10 | if (!thisMethod.getDeclaringClass().isInstance(target)) | ||||||||||
9 | throw new ClassCastException(target.getClass().getName()); | 11 | throw new ClassCastException(target.getClass().getName()); | |||||||||||
10 | returnValue = method.invoke(target, args); |
| 12 | returnValue = thisMethod.invoke(target, args); | ||||||||||
else | else | |||||||||||||
11 | if (!method.isAccessible()) |
| 13 | if (!thisMethod.isAccessible()) | ||||||||||
12 | method.setAccessible(true); |
| 14 | thisMethod.setAccessible(true); | ||||||||||
13 | returnValue = method.invoke(target, args); |
| 15 | returnValue = thisMethod.invoke(target, args); | ||||||||||
14 | return returnValue == target ? proxy : returnValue; | 16 | return returnValue == target ? proxy : returnValue; | |||||||||||
else | else | |||||||||||||
15 | return result; | 17 | return result; |
Row | Violation |
---|