public Serializable disassemble( Object value, SessionImplementor session, Object owner) throws HibernateException { if ( isNotEmbedded( session ) ) { return getIdentifierType( session ).disassemble( value, session, owner ); } if ( value == null ) { return null; } else { // cache the actual id of the object, not the value of the // property-ref, which might not be initialized Object id = ForeignKeys.getEntityIdentifierIfNotUnsaved( getAssociatedEntityName(), value, session ); if ( id == null ) { throw new AssertionFailure( "cannot cache a reference to an object with a null id: " + getAssociatedEntityName() ); } return getIdentifierType( session ).disassemble( id, session, owner );
public Serializable disassemble(Object value, SessionImplementor session, Object owner) throws HibernateException { if ( isNotEmbedded(session) ) { return getIdentifierType(session).disassemble(value, session, owner); } if (value==null) { return null; } else { // cache the actual id of the object, not the value of the // property-ref, which might not be initialized Object id = ForeignKeys.getEntityIdentifierIfNotUnsaved( getAssociatedEntityName(), value, session ); if (id==null) { throw new AssertionFailure( "cannot cache a reference to an object with a null id: " + getAssociatedEntityName() ); } return getIdentifierType(session).disassemble(id, session, owner);
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/type/ManyToOneType.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/type/SpecialOneToOneType.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public Serializable disassemble(
1
public Serializable disassemble(
2
			Object value,
2
Object value,
3
			SessionImplementor session,
3
 SessionImplementor session,
4
			Object owner) 
4
 Object owner)
5
throws HibernateException {
5
	throws HibernateException {
6
		if ( isNotEmbedded( session ) ) {
6
		if ( isNotEmbedded(session) ) {
7
			return getIdentifierType( session ).disassemble( value, session, owner );
7
			return getIdentifierType(session).disassemble(value, session, owner);
8
		}
8
		}
9
		
9
		
10
		if ( value == null ) {
10
		if (value==null) {
11
			return null;
11
			return null;
12
		}
12
		}
13
		else {
13
		else {
14
			// cache the actual id of the object, not the value of the
14
			// cache the actual id of the object, not the value of the
15
			// property-ref, which might not be initialized
15
			// property-ref, which might not be initialized
16
			Object id = ForeignKeys.getEntityIdentifierIfNotUnsaved( 
16
			Object id = ForeignKeys.getEntityIdentifierIfNotUnsaved( 
17
					getAssociatedEntityName(), 
17
getAssociatedEntityName(), 
18
					value, 
18
value, 
19
					session
19
session
20
			);
20
 );
21
			if ( id == null ) {
21
			if (id==null) {
22
				throw new AssertionFailure(
22
				throw new AssertionFailure(
23
						"cannot cache a reference to an object with a null id: " + 
23
						"cannot cache a reference to an object with a null id: " + 
24
						getAssociatedEntityName()
24
						getAssociatedEntityName() 
25
				);
25
				);
26
			}
26
			}
27
			return getIdentifierType( session ).disassemble( id, session, owner );
27
			return getIdentifierType(session).disassemble(id, session, owner);
28
		
28
		
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0