File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/proxy/pojo/javassist/JavassistLazyInitializer.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/proxy/pojo/cglib/CGLIBLazyInitializer.java | |||
Method name: Object invoke(Object, Method, Method, Object[])
|
Method name: Object invoke(Object, Method, Object[])
|
|||
Number of AST nodes: 11 | Number of AST nodes: 11 | |||
1 | Object target = getImplementation();↵ | 1 | Object target = getImplementation();↵ | |
2 | ↵ | 2 | try {↵ | |
3 | final Object returnValue;↵ | 3 | final Object returnValue;↵ | |
4 | try {↵ | 4 | ↵ | |
5 | if ( ReflectHelper.isPublic( persistentClass, thisMethod ) ) {↵ | 5 | if ( ReflectHelper.isPublic( persistentClass, method ) ) {↵ | |
6 | if ( !thisMethod.getDeclaringClass().isInstance( target ) ) {↵ | 6 | if ( !method.getDeclaringClass().isInstance( target ) ) {↵ | |
7 | throw new ClassCastException( target.getClass().getName() );↵ | 7 | throw new ClassCastException( target.getClass().getName() );↵ | |
8 | }↵ | 8 | }↵ | |
9 | returnValue = thisMethod.invoke( target, args );↵ | 9 | returnValue = method.invoke( target, args );↵ | |
10 | }↵ | 10 | }↵ | |
11 | else {↵ | 11 | else {↵ | |
12 | if ( !thisMethod.isAccessible() ) {↵ | 12 | if ( !method.isAccessible() ) {↵ | |
13 | thisMethod.setAccessible( true );↵ | 13 | method.setAccessible( true );↵ | |
14 | }↵ | 14 | }↵ | |
15 | returnValue = thisMethod.invoke( target, args );↵ | 15 | returnValue = method.invoke( target, args );↵ | |
16 | }↵ | 16 | }↵ | |
17 | return returnValue == target ? proxy : returnValue;↵ | 17 | return returnValue == target ? proxy : returnValue;↵ | |
18 | }↵ | 18 | }↵ | |
19 | catch ( InvocationTargetException ite ) {↵ | 19 | catch ( InvocationTargetException ite ) {↵ | |
20 | throw ite.getTargetException();↵ | 20 | throw ite.getTargetException();↵ | |
21 | } | 21 |
| |
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.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 31 |
Number of mapped statements | 10 |
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.5 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6 | Object target = getImplementation(); | 4 | Object target = getImplementation(); | |||||||||||
7 | final Object returnValue; | | ||||||||||||
8 | try | 5 | try | |||||||||||
| 6 | final Object returnValue; | ||||||||||||
9 | if (ReflectHelper.isPublic(persistentClass, thisMethod)) |
| 7 | if (ReflectHelper.isPublic(persistentClass, method)) | ||||||||||
10 | if (!thisMethod.getDeclaringClass().isInstance(target)) |
| 8 | if (!method.getDeclaringClass().isInstance(target)) | ||||||||||
11 | throw new ClassCastException(target.getClass().getName()); | 9 | throw new ClassCastException(target.getClass().getName()); | |||||||||||
12 | returnValue = thisMethod.invoke(target, args); |
| 10 | returnValue = method.invoke(target, args); | ||||||||||
else | else | |||||||||||||
13 | if (!thisMethod.isAccessible()) |
| 11 | if (!method.isAccessible()) | ||||||||||
14 | thisMethod.setAccessible(true); |
| 12 | method.setAccessible(true); | ||||||||||
15 | returnValue = thisMethod.invoke(target, args); |
| 13 | returnValue = method.invoke(target, args); | ||||||||||
16 | return returnValue == target ? proxy : returnValue; | 14 | return returnValue == target ? proxy : returnValue; |
Row | Violation |
---|