super.validate(mapping);
if ( !getIdentifier().isValid(mapping) ) {
throw new MappingException(
"collection id mapping has wrong number of columns: " +
getRole() +
" type: " +
getIdentifier().getType().getName()
);
}
super.validate(mapping);
if ( !getIdentifier().isValid(mapping) ) {
throw new MappingException(
"identifier mapping has wrong number of columns: " +
getEntityName() +
" type: " +
getIdentifier().getType().getName()
);
}
checkCompositeIdentifier();
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/mapping/IdentifierCollection.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/mapping/RootClass.java
|
Method name: void validate(Mapping)
|
|
Method name: void validate(Mapping)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 4
|
|
1 | super.validate(mapping);↵ | | 1 | super.validate(mapping);↵
|
2 | if ( !getIdentifier().isValid(mapping) ) {↵ | | 2 | if ( !getIdentifier().isValid(mapping) ) {↵
|
3 | throw new MappingException(↵ | | 3 | throw new MappingException(↵
|
4 | "collection id mapping has wrong number of columns: " +↵ | | 4 | "identifier mapping has wrong number of columns: " +↵
|
5 | getRole() +↵ | | 5 | getEntityName() +↵
|
6 | " type: " +↵ | | 6 | " type: " +↵
|
7 | getIdentifier().getType().getName()↵ | | 7 | getIdentifier().getType().getName()↵
|
8 | );↵ | | 8 | );↵
|
9 | } | | 9 | }↵
|
| | | 10 | checkCompositeIdentifier();
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 6 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.9 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | super.validate(mapping); | | 1 | super.validate(mapping); |
2 | if (!getIdentifier().isValid(mapping)) | | 2 | if (!getIdentifier().isValid(mapping)) |
3 | throw new MappingException("collection id mapping has wrong number of columns: " + getRole() + " type: " + getIdentifier().getType().getName()); | | 3 | throw new MappingException("identifier mapping has wrong number of columns: " + getEntityName() + " type: " + getIdentifier().getType().getName()); |
| | | 4 | checkCompositeIdentifier(); |
Precondition Violations (0)
Row |
Violation |