Join join = new Join(); join.setPersistentClass( persistentClass ); bindJoin( subnode, join, mappings, inheritedMetas ); persistentClass.addJoin( join );
if ( propertyName != null ) { Property prop = new Property(); prop.setValue( id ); bindProperty( idNode, prop, mappings, inheritedMetas ); entity.setIdentifierProperty( prop ); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cfg/HbmBinder.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cfg/HbmBinder.java
Method name: void createClassProperties(Element, PersistentClass, Mappings, java.util.Map, UniqueKey, boolean, boolean, boolean) Method name: void bindSimpleId(Element, RootClass, Mappings, java.util.Map)
Number of AST nodes: 4 Number of AST nodes: 5
1
Join join = new Join();
2
				join.setPersistentClass( persistentClass
1
if ( propertyName != null ) {
2
			Property prop = new Property();
3
 );
3
			prop.setValue( id );
4
				bindJoin( subnode, join, mappings, inheritedMetas );
4
			bindProperty( idNode, prop, mappings, inheritedMetas );
5
				persistentClass.addJoin( join );
5
			entity.setIdentifierProperty( prop );
6
		}
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.0
Clones locationClones are declared in the same class
Number of node comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                      
    12
    Property prop = new Property();
                                                
    13
    prop.setValue(id);
    31
    Join join = new Join();
    31
    Join join = new Join();
    Preondition Violations
    Unmatched statement Join join=new Join(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                      
    32
    join.setPersistentClass(persistentClass);
    32
    join.setPersistentClass(persistentClass);
    14
    bindProperty(idNode, prop, mappings, inheritedMetas);
    Differences
    Expression1Expression2Difference
    setPersistentClassbindPropertyMETHOD_INVOCATION_NAME_MISMATCH
    join.setPersistentClass(persistentClass)bindProperty(idNode,prop,mappings,inheritedMetas)ARGUMENT_NUMBER_MISMATCH
    joinMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression join.setPersistentClass(persistentClass) is a void method call, and thus it cannot be parameterized
    Expression bindProperty(idNode,prop,mappings,inheritedMetas) is a void method call, and thus it cannot be parameterized
    Expression join.setPersistentClass(persistentClass) is a void method call, and thus it cannot be parameterized
    Expression bindProperty(idNode,prop,mappings,inheritedMetas) is a void method call, and thus it cannot be parameterized
    14
    bindProperty(idNode, prop, mappings, inheritedMetas);
    33
    bindJoin(subnode, join, mappings, inheritedMetas);
    33
    bindJoin(subnode, join, mappings, inheritedMetas);
    15
    entity.setIdentifierProperty(prop);
    Differences
    Expression1Expression2Difference
    bindJoinsetIdentifierPropertyMETHOD_INVOCATION_NAME_MISMATCH
    bindJoin(subnode,join,mappings,inheritedMetas)entity.setIdentifierProperty(prop)ARGUMENT_NUMBER_MISMATCH
    entityMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression bindJoin(subnode,join,mappings,inheritedMetas) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method bindJoin
    Expression bindJoin(subnode,join,mappings,inheritedMetas) is a void method call, and thus it cannot be parameterized
    Expression entity.setIdentifierProperty(prop) is a void method call, and thus it cannot be parameterized
    Expression bindJoin(subnode,join,mappings,inheritedMetas) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method bindJoin
    Expression bindJoin(subnode,join,mappings,inheritedMetas) is a void method call, and thus it cannot be parameterized
    Expression entity.setIdentifierProperty(prop) is a void method call, and thus it cannot be parameterized
    15
    entity.setIdentifierProperty(prop);
    34
    persistentClass.addJoin(join);
    34
    persistentClass.addJoin(join);
    Preondition Violations
    Unmatched statement persistentClass.addJoin(join); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                        
    Precondition Violations (12)
    Row Violation
    1Unmatched statement Join join=new Join(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Expression join.setPersistentClass(persistentClass) is a void method call, and thus it cannot be parameterized
    3Expression bindProperty(idNode,prop,mappings,inheritedMetas) is a void method call, and thus it cannot be parameterized
    4Expression join.setPersistentClass(persistentClass) is a void method call, and thus it cannot be parameterized
    5Expression bindProperty(idNode,prop,mappings,inheritedMetas) is a void method call, and thus it cannot be parameterized
    6Expression bindJoin(subnode,join,mappings,inheritedMetas) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression bindJoin(subnode,join,mappings,inheritedMetas) is a void method call, and thus it cannot be parameterized
    8Expression entity.setIdentifierProperty(prop) is a void method call, and thus it cannot be parameterized
    9Expression bindJoin(subnode,join,mappings,inheritedMetas) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression bindJoin(subnode,join,mappings,inheritedMetas) is a void method call, and thus it cannot be parameterized
    11Expression entity.setIdentifierProperty(prop) is a void method call, and thus it cannot be parameterized
    12Unmatched statement persistentClass.addJoin(join); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted