File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/bytecode/cglib/BytecodeProviderImpl.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/bytecode/javassist/BytecodeProviderImpl.java | |||
Method name: ReflectionOptimizer getReflectionOptimizer(Class, String[], String[], Class[])
|
Method name: ReflectionOptimizer getReflectionOptimizer(Class, String[], String[], Class[])
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | try {↵ | 1 | try {↵ | |
2 | fastClass = FastClass.create( clazz );↵ | 2 | fastClass = FastClass.create( clazz );↵ | |
3 | bulkBean = BulkBean.create( clazz, getterNames, setterNames, types );↵ | 3 | bulkAccessor = BulkAccessor.create( clazz, getterNames, setterNames, types );↵ | |
4 | if ( !clazz.isInterface() && !Modifier.isAbstract( clazz.getModifiers() ) ) {↵ | 4 | if ( !clazz.isInterface() && !Modifier.isAbstract( clazz.getModifiers() ) ) {↵ | |
5 | if ( fastClass == null ) {↵ | 5 | if ( fastClass == null ) {↵ | |
6 | bulkBean = null;↵ | 6 | bulkAccessor = null;↵ | |
7 | }↵ | 7 | }↵ | |
8 | else {↵ | 8 | else {↵ | |
9 | //test out the optimizer:↵ | 9 | //test out the optimizer:↵ | |
10 | Object instance = fastClass.newInstance();↵ | 10 | Object instance = fastClass.newInstance();↵ | |
11 | bulkBean.setPropertyValues( instance, bulkBean.getPropertyValues( instance ) );↵ | 11 | bulkAccessor.setPropertyValues( instance, bulkAccessor.getPropertyValues( instance ) );↵ | |
12 | }↵ | 12 | }↵ | |
13 | }↵ | 13 | }↵ | |
14 | }↵ | 14 | }↵ | |
15 | catch( Throwable t ) {↵ | 15 | catch ( Throwable t ) {↵ | |
16 | fastClass = null;↵ | 16 | fastClass = null;↵ | |
17 | bulkBean = null;↵ | 17 | bulkAccessor = null;↵ | |
18 | String message = "reflection optimizer disabled for: " +↵ | 18 | String message = "reflection optimizer disabled for: " +↵ | |
19 | clazz.getName() +↵ | 19 | clazz.getName() +↵ | |
20 | " [" +↵ | 20 | " [" +↵ | |
21 | StringHelper.unqualify( t.getClass().getName() ) +↵ | 21 | StringHelper.unqualify( t.getClass().getName() ) +↵ | |
22 | ": " +↵ | 22 | ": " +↵ | |
23 | t.getMessage();↵ | 23 | t.getMessage();↵ | |
24 | if (t instanceof BulkBeanException ) {↵ | 24 | if ( t instanceof BulkAccessorException ) {↵ | |
25 | int index = ( (BulkBeanException) t ).getIndex();↵ | 25 | int index = ( ( BulkAccessorException ) t ).getIndex();↵ | |
26 | if (index >= 0) {↵ | 26 | if ( index >= 0 ) {↵ | |
27 | message += " (property " + setterNames[index] + ")";↵ | 27 | message += " (property " + setterNames[index] + ")";↵ | |
28 | }↵ | 28 | }↵ | |
29 | }↵ | 29 | }↵ | |
30 | log.debug( message );↵ | 30 | log.debug( message );↵ | |
31 | } | 31 |
| |
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 different classes |
Number of node comparisons | 22 |
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.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6 | if (!clazz.isInterface() && !Modifier.isAbstract(clazz.getModifiers())) | 6 | if (!clazz.isInterface() && !Modifier.isAbstract(clazz.getModifiers())) | ||||||||||||||||||||||
7 | if (fastClass == null) |
| 7 | if (fastClass == null) | |||||||||||||||||||||
| 8 | bulkAccessor = null; | |||||||||||||||||||||||
8 | bulkBean = null; | | |||||||||||||||||||||||
else | else | ||||||||||||||||||||||||
9 | Object instance = fastClass.newInstance(); |
| 9 | Object instance = fastClass.newInstance(); | |||||||||||||||||||||
10 | bulkBean.setPropertyValues(instance, bulkBean.getPropertyValues(instance)); |
| 10 | bulkAccessor.setPropertyValues(instance, bulkAccessor.getPropertyValues(instance)); |
Row | Violation |
---|---|
1 | Type net.sf.cglib.reflect.FastClass of variable fastClass does not match with type org.hibernate.bytecode.javassist.FastClass of variable fastClass |
2 | Type net.sf.cglib.reflect.FastClass of variable fastClass does not match with type org.hibernate.bytecode.javassist.FastClass of variable fastClass |
3 | Type net.sf.cglib.beans.BulkBean of variable bulkBean does not match with type org.hibernate.bytecode.javassist.BulkAccessor of variable bulkAccessor |
4 | Type net.sf.cglib.beans.BulkBean of variable bulkBean does not match with type org.hibernate.bytecode.javassist.BulkAccessor of variable bulkAccessor |