if ( getCollectionOwners()!=null ) { return list.get(0); } else { throw new HibernateException("More than one row was found"); }
if ( getCollectionOwners()!=null ) { return list.get(0); } else { throw new HibernateException( "More than one row with the given identifier was found: " + id + ", for class: " + persister.getEntityName() ); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/loader/entity/CollectionElementLoader.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/loader/entity/AbstractEntityLoader.java
Method name: Object loadElement(SessionImplementor, Object, Object) Method name: Object load(SessionImplementor, Object, Object, Serializable)
Number of AST nodes: 3 Number of AST nodes: 3
1
if ( getCollectionOwners()!=null ) {
1
if ( getCollectionOwners()!=null ) {
2
				return list.get(0);
2
				return list.get(0);
3
			}
3
			}
4
			else {
4
			else {
5
				throw new HibernateException(
5
				throw new HibernateException(
6
"More than one row was found"
6
						"More than one row with the given identifier was found: " +
7
						id +
8
						", for class: " +
9
						persister.getEntityName()
7
);
10
					);
8
			}
11
			}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.4
Clones locationClones are in different classes having the same super class
Number of node comparisons12
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    6
    if (getCollectionOwners() != null)
    6
    if (getCollectionOwners() != null)
    7
    return list.get(0);
    7
    return list.get(0);
    else
    else
    8
    throw new HibernateException("More than one row was found");
    8
    throw new HibernateException("More than one row was found");
    8
    throw new HibernateException("More than one row with the given identifier was found: " + id + ", for class: " + persister.getEntityName());
    Differences
    Expression1Expression2Difference
    "More than one row was found""More than one row with the given identifier was found: " + id + ", for class: "+ persister.getEntityName()TYPE_COMPATIBLE_REPLACEMENT
    8
    throw new HibernateException("More than one row with the given identifier was found: " + id + ", for class: " + persister.getEntityName());
    Precondition Violations (0)
    Row Violation