value = new ManyToOne( component.getTable() ); String relativePath; if (isEmbedded) { relativePath = propertyName; } else { relativePath = subpath.substring( component.getOwner().getEntityName().length() + 1 ); } bindManyToOne( subnode, (ManyToOne) value, relativePath, isNullable, mappings );
value = new SimpleValue( component.getTable() ); String relativePath; if (isEmbedded) { relativePath = propertyName; } else { relativePath = subpath.substring( component.getOwner().getEntityName().length() + 1 ); } bindSimpleValue( subnode, (SimpleValue) value, isNullable, relativePath, 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 bindComponent(Element, Component, String, String, String, boolean, boolean, Mappings, java.util.Map, boolean) Method name: void bindComponent(Element, Component, String, String, String, boolean, boolean, Mappings, java.util.Map, boolean)
Number of AST nodes: 6 Number of AST nodes: 6
1
value = new ManyToOne( component.getTable() );
1
value = new SimpleValue( component.getTable() );
2
				String relativePath;
2
				String relativePath;
3
				if (isEmbedded) {
3
				if (isEmbedded) {
4
					relativePath = propertyName;
4
					relativePath = propertyName;
5
				}
5
				}
6
				else {
6
				else {
7
					relativePath = subpath.substring( component.getOwner().getEntityName().length() + 1 );
7
					relativePath = subpath.substring( component.getOwner().getEntityName().length() + 1 );
8
				}
8
				}
9
				bindManyToOne( subnode, (ManyToOne) value, relativePath, isNullable, mappings );
9
				bindSimpleValue( subnode, (SimpleValue) value, isNullable, relativePath, 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.4
Clones locationClones are in the same method
Number of node comparisons20
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)5.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    38
    value = new ManyToOne(component.getTable());
    38
    value = new ManyToOne(component.getTable());
    55
    value = new SimpleValue(component.getTable());
    Differences
    Expression1Expression2Difference
    org.hibernate.mapping.ManyToOneorg.hibernate.mapping.SimpleValueSUBCLASS_TYPE_MISMATCH
    55
    value = new SimpleValue(component.getTable());
    39
    String relativePath;
    56
    String relativePath;
    40
    if (isEmbedded)
    57
    if (isEmbedded)
    41
    relativePath = propertyName;
    58
    relativePath = propertyName;
    else
    else
    42
    relativePath = subpath.substring(component.getOwner().getEntityName().length() + 1);
    59
    relativePath = subpath.substring(component.getOwner().getEntityName().length() + 1);
    43
    bindManyToOne(subnode, (ManyToOne)value, relativePath, isNullable, mappings);
    43
    bindManyToOne(subnode, (ManyToOne)value, relativePath, isNullable, mappings);
    Preondition Violations
    Unmatched statement bindManyToOne(subnode,(ManyToOne)value,relativePath,isNullable,mappings); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                              
                                                                                                                                                                      
    60
    bindSimpleValue(subnode, (SimpleValue)value, isNullable, relativePath, mappings);
    Preondition Violations
    Unmatched statement bindSimpleValue(subnode,(SimpleValue)value,isNullable,relativePath,mappings); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    60
    bindSimpleValue(subnode, (SimpleValue)value, isNullable, relativePath, mappings);
    Precondition Violations (3)
    Row Violation
    1Unmatched statement bindManyToOne(subnode,(ManyToOne)value,relativePath,isNullable,mappings); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement bindSimpleValue(subnode,(SimpleValue)value,isNullable,relativePath,mappings); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Clone fragment #1 returns variables value, relativePath , while Clone fragment #2 returns variables value, relativePath