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 );
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: Serializable disassemble(Object, SessionImplementor, Object)
|
|
Method name: Serializable disassemble(Object, SessionImplementor, Object)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | Object id = ForeignKeys.getEntityIdentifierIfNotUnsaved( ↵ | | 1 | Object id = ForeignKeys.getEntityIdentifierIfNotUnsaved( ↵
|
2 | getAssociatedEntityName(), ↵ | | 2 | getAssociatedEntityName(), ↵
|
3 | value, ↵ | | 3 | value, ↵
|
4 | session↵ | | 4 | session↵
|
5 | );↵ | | 5 | );↵
|
6 | if ( id == null ) {↵ | | 6 | if (id==null) {↵
|
7 | throw new AssertionFailure(↵ | | 7 | throw new AssertionFailure(↵
|
8 | "cannot cache a reference to an object with a null id: " + ↵ | | 8 | "cannot cache a reference to an object with a null id: " + ↵
|
9 | getAssociatedEntityName()↵ | | 9 | getAssociatedEntityName() ↵
|
10 | );↵ | | 10 | );↵
|
11 | }↵ | | 11 | }↵
|
12 | return getIdentifierType( session ).disassemble( id, session, owner ); | | 12 | return getIdentifierType(session).disassemble(id, session, owner);
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 9 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 15.0 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
5 | Object id = ForeignKeys.getEntityIdentifierIfNotUnsaved(getAssociatedEntityName(), value, session); | | 5 | Object id = ForeignKeys.getEntityIdentifierIfNotUnsaved(getAssociatedEntityName(), value, session); |
6 | if (id == null) | | 6 | if (id == null) |
7 | throw new AssertionFailure("cannot cache a reference to an object with a null id: " + getAssociatedEntityName()); | | 7 | throw new AssertionFailure("cannot cache a reference to an object with a null id: " + getAssociatedEntityName()); |
8 | return getIdentifierType(session).disassemble(id, session, owner); | | 8 | return getIdentifierType(session).disassemble(id, session, owner); |
Precondition Violations (1)
Row |
Violation |
1 | Not all possible execution flows end in a return statement |