File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/mapping/Collection.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/mapping/PersistentClass.java | |||
Method name: void checkColumnDuplication(java.util.Set, Iterator)
|
Method name: void checkColumnDuplication(Set, Iterator)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 2 | |||
1 | Selectable s = (Selectable) columns.next();↵ | 1 | Selectable columnOrFormula = (Selectable) columns.next();↵ | |
2 | if ( !s.isFormula() ) {↵ | 2 | if ( !columnOrFormula.isFormula() ) {↵ | |
3 | Column col = (Column) s;↵ | 3 | Column col = (Column) ↵ | |
4 | if ( !distinctColumns.add( col.getName() ) ) {↵ | |||
5 | throw new MappingException( "Repeated column in mapping for collection: "↵ | |||
6 | + getRole()↵ | |||
7 | + " column: "↵ | |||
8 | + col.getName() );↵ | |||
9 | }↵ | |||
10 | } | 4 |
| |
See real code fragment | See real code fragment |
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.0 |
Clones location | Clones are in different classes |
Number of node comparisons | 7 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | Selectable s = (Selectable)columns.next(); |
| 2 | Selectable columnOrFormula = (Selectable)columns.next(); | ||||||||||
3 | if (!s.isFormula()) |
| 3 | if (!columnOrFormula.isFormula()) | ||||||||||
4 | Column col = (Column)s; |
| 4 | Column col = (Column)columnOrFormula; | ||||||||||
5 | if (!distinctColumns.add(col.getName())) |
| | |||||||||||
6 | throw new MappingException("Repeated column in mapping for collection: " + getRole() + " column: " + col.getName()); |
| |
Row | Violation |
---|---|
1 | Unmatched statement if(!distinctColumns.add(col.getName())) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement throw new MappingException("Repeated column in mapping for collection: " + getRole() + " column: "+ col.getName()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched throw new MappingException("Repeated column in mapping for collection: " + getRole() + " column: "+ col.getName()); |
4 | Clone fragment #1 returns variables , while Clone fragment #2 returns variables col |