SimpleValue elt = new SimpleValue( collection.getCollectionTable() ); collection.setElement( elt ); bindSimpleValue( subnode, elt, true, Collection.DEFAULT_ELEMENT_COLUMN_NAME, 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
SimpleValue elt = new SimpleValue( collection.getCollectionTable() );
1
OneToMany oneToMany = new OneToMany( collection.getOwner() );
2
				collection.setElement( elt );
2
			collection.setElement( oneToMany );
3
				bindSimpleValue(
3
			bind
4
						subnode,
5
						elt,
6
						true,
7
						Collection.DEFAULT_ELEMENT_COLUMN_NAME,
8
						mappings
4
OneToMany( oneToManyNode, oneToMany, mappings
9
					);
5
 );
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
    32
    SimpleValue elt = new SimpleValue(collection.getCollectionTable());
    32
    SimpleValue elt = new SimpleValue(collection.getCollectionTable());
    Preondition Violations
    Unmatched statement SimpleValue elt=new SimpleValue(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());
    33
    collection.setElement(elt);
    33
    collection.setElement(elt);
    50
    collection.setElement(oneToMany);
    Differences
    Expression1Expression2Difference
    eltoneToManyVARIABLE_NAME_MISMATCH
    org.hibernate.mapping.SimpleValueorg.hibernate.mapping.OneToManyVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.mapping.SimpleValue of variable elt does not match with type org.hibernate.mapping.OneToMany of variable oneToMany
    • Make classes org.hibernate.mapping.SimpleValue and org.hibernate.mapping.OneToMany extend a common superclass
    50
    collection.setElement(oneToMany);
    34
    bindSimpleValue(subnode, elt, true, Collection.DEFAULT_ELEMENT_COLUMN_NAME, mappings);
    34
    bindSimpleValue(subnode, elt, true, Collection.DEFAULT_ELEMENT_COLUMN_NAME, mappings);
    51
    bindOneToMany(oneToManyNode, oneToMany, mappings);
    Differences
    Expression1Expression2Difference
    bindSimpleValuebindOneToManyMETHOD_INVOCATION_NAME_MISMATCH
    bindSimpleValue(subnode,elt,true,Collection.DEFAULT_ELEMENT_COLUMN_NAME,mappings)bindOneToMany(oneToManyNode,oneToMany,mappings)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression bindSimpleValue(subnode,elt,true,Collection.DEFAULT_ELEMENT_COLUMN_NAME,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 bindSimpleValue(subnode,elt,true,Collection.DEFAULT_ELEMENT_COLUMN_NAME,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 SimpleValue elt=new SimpleValue(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.SimpleValue of variable elt does not match with type org.hibernate.mapping.OneToMany of variable oneToMany
    3Expression bindSimpleValue(subnode,elt,true,Collection.DEFAULT_ELEMENT_COLUMN_NAME,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 bindSimpleValue(subnode,elt,true,Collection.DEFAULT_ELEMENT_COLUMN_NAME,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