Any element = new Any( collection.getCollectionTable() ); collection.setElement( element ); bindAny( subnode, element, true, mappings );
OneToMany oneToMany = new OneToMany( collection.getOwner() ); collection.setElement( oneToMany ); bindOneToMany( oneToManyNode, oneToMany, mappings );
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 bindCollectionSecondPass(Element, Collection, java.util.Map, Mappings, java.util.Map) Method name: void bindCollection(Element, Collection, String, String, Mappings, java.util.Map)
Number of AST nodes: 3 Number of AST nodes: 3
1
Any element = new Any( collection.getCollectionTable() );
1
OneToMany oneToMany = new OneToMany( collection.getOwner() );
2
				collection.setElement( element );
2
			collection.setElement( oneToMany );
3
				bindAny( subnode, element, true, mappings );
3
			bindOneToMany( oneToManyNode, oneToMany, mappings );
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 comparisons7
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    45
    Any element = new Any(collection.getCollectionTable());
    45
    Any element = new Any(collection.getCollectionTable());
    Preondition Violations
    Unmatched statement Any element=new Any(collection.getCollectionTable()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                      
                                                                                                                              
    49
    OneToMany oneToMany = new OneToMany(collection.getOwner());
    46
    collection.setElement(element);
    46
    collection.setElement(element);
    50
    collection.setElement(oneToMany);
    Differences
    Expression1Expression2Difference
    elementoneToManyVARIABLE_NAME_MISMATCH
    org.hibernate.mapping.Anyorg.hibernate.mapping.OneToManyVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.mapping.Any of variable element does not match with type org.hibernate.mapping.OneToMany of variable oneToMany
    • Make classes org.hibernate.mapping.Any and org.hibernate.mapping.OneToMany extend a common superclass
    50
    collection.setElement(oneToMany);
    47
    bindAny(subnode, element, true, mappings);
    47
    bindAny(subnode, element, true, mappings);
    51
    bindOneToMany(oneToManyNode, oneToMany, mappings);
    Differences
    Expression1Expression2Difference
    bindAnybindOneToManyMETHOD_INVOCATION_NAME_MISMATCH
    bindAny(subnode,element,true,mappings)bindOneToMany(oneToManyNode,oneToMany,mappings)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression bindAny(subnode,element,true,mappings) is a void method call, and thus it cannot be parameterized
    Expression bindOneToMany(oneToManyNode,oneToMany,mappings) is a void method call, and thus it cannot be parameterized
    Expression bindAny(subnode,element,true,mappings) is a void method call, and thus it cannot be parameterized
    Expression bindOneToMany(oneToManyNode,oneToMany,mappings) is a void method call, and thus it cannot be parameterized
    51
    bindOneToMany(oneToManyNode, oneToMany, mappings);
    Precondition Violations (6)
    Row Violation
    1Unmatched statement Any element=new Any(collection.getCollectionTable()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Type org.hibernate.mapping.Any of variable element does not match with type org.hibernate.mapping.OneToMany of variable oneToMany
    3Expression bindAny(subnode,element,true,mappings) is a void method call, and thus it cannot be parameterized
    4Expression bindOneToMany(oneToManyNode,oneToMany,mappings) is a void method call, and thus it cannot be parameterized
    5Expression bindAny(subnode,element,true,mappings) is a void method call, and thus it cannot be parameterized
    6Expression bindOneToMany(oneToManyNode,oneToMany,mappings) is a void method call, and thus it cannot be parameterized