if ( !clazz.isInterface() && !Modifier.isAbstract( clazz.getModifiers() ) ) { if ( fastClass == null ) { bulkBean = null; } else { //test out the optimizer: Object instance = fastClass.newInstance(); bulkBean.setPropertyValues( instance, bulkBean.getPropertyValues( instance ) ); } }
if ( !clazz.isInterface() && !Modifier.isAbstract( clazz.getModifiers() ) ) { if ( fastClass == null ) { bulkAccessor = null; } else { //test out the optimizer: Object instance = fastClass.newInstance(); bulkAccessor.setPropertyValues( instance, bulkAccessor.getPropertyValues( instance ) ); } }
Clone fragments detected by clone detection tool
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: 5 Number of AST nodes: 5
1
if ( !clazz.isInterface() && !Modifier.isAbstract( clazz.getModifiers() ) ) {
1
if ( !clazz.isInterface() && !Modifier.isAbstract( clazz.getModifiers() ) ) {
2
				if ( fastClass == null ) {
2
				if ( fastClass == null ) {
3
					bulkBean = null;
3
					bulkAccessor = null;
4
				}
4
				}
5
				else {
5
				else {
6
					//test out the optimizer:
6
					//test out the optimizer:
7
					Object instance = fastClass.newInstance();
7
					Object instance = fastClass.newInstance();
8
					bulkBean.setPropertyValues( instance, bulkBean.getPropertyValues( instance ) );
8
					bulkAccessor.setPropertyValues( instance, bulkAccessor.getPropertyValues( instance ) );
9
				}
9
				}
10
			}
10
			}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.4
Clones locationClones are in different classes
Number of node comparisons18
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 2
    Mapped Statements
    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)
    7
    if (fastClass == null)
    Differences
    Expression1Expression2Difference
    net.sf.cglib.reflect.FastClassorg.hibernate.bytecode.javassist.FastClassVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sf.cglib.reflect.FastClass of variable fastClass does not match with type org.hibernate.bytecode.javassist.FastClass of variable fastClass
    • Make classes net.sf.cglib.reflect.FastClass and org.hibernate.bytecode.javassist.FastClass extend a common superclass
    7
    if (fastClass == null)
                                              
    8
    bulkAccessor = null;
    8
    bulkBean = null;
                                      
    else
    else
    9
    Object instance = fastClass.newInstance();
    9
    Object instance = fastClass.newInstance();
    9
    Object instance = fastClass.newInstance();
    Differences
    Expression1Expression2Difference
    net.sf.cglib.reflect.FastClassorg.hibernate.bytecode.javassist.FastClassVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sf.cglib.reflect.FastClass of variable fastClass does not match with type org.hibernate.bytecode.javassist.FastClass of variable fastClass
    • Make classes net.sf.cglib.reflect.FastClass and org.hibernate.bytecode.javassist.FastClass extend a common superclass
    9
    Object instance = fastClass.newInstance();
    10
    bulkBean.setPropertyValues(instance, bulkBean.getPropertyValues(instance));
    10
    bulkBean.setPropertyValues(instance, bulkBean.getPropertyValues(instance));
    10
    bulkAccessor.setPropertyValues(instance, bulkAccessor.getPropertyValues(instance));
    Differences
    Expression1Expression2Difference
    bulkBeanbulkAccessorVARIABLE_NAME_MISMATCH
    net.sf.cglib.beans.BulkBeanorg.hibernate.bytecode.javassist.BulkAccessorVARIABLE_TYPE_MISMATCH
    bulkBeanbulkAccessorVARIABLE_NAME_MISMATCH
    net.sf.cglib.beans.BulkBeanorg.hibernate.bytecode.javassist.BulkAccessorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sf.cglib.beans.BulkBean of variable bulkBean does not match with type org.hibernate.bytecode.javassist.BulkAccessor of variable bulkAccessor
    • Make classes net.sf.cglib.beans.BulkBean and org.hibernate.bytecode.javassist.BulkAccessor extend a common superclass
    Type net.sf.cglib.beans.BulkBean of variable bulkBean does not match with type org.hibernate.bytecode.javassist.BulkAccessor of variable bulkAccessor
    • Make classes net.sf.cglib.beans.BulkBean and org.hibernate.bytecode.javassist.BulkAccessor extend a common superclass
    10
    bulkAccessor.setPropertyValues(instance, bulkAccessor.getPropertyValues(instance));
    Precondition Violations (4)
    Row Violation
    1Type net.sf.cglib.reflect.FastClass of variable fastClass does not match with type org.hibernate.bytecode.javassist.FastClass of variable fastClass
    2Type net.sf.cglib.reflect.FastClass of variable fastClass does not match with type org.hibernate.bytecode.javassist.FastClass of variable fastClass
    3Type net.sf.cglib.beans.BulkBean of variable bulkBean does not match with type org.hibernate.bytecode.javassist.BulkAccessor of variable bulkAccessor
    4Type net.sf.cglib.beans.BulkBean of variable bulkBean does not match with type org.hibernate.bytecode.javassist.BulkAccessor of variable bulkAccessor