File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/mapping/Table.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/mapping/Table.java | |||
Method name: Index addIndex(Index)
|
Method name: UniqueKey addUniqueKey(UniqueKey)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | Index current = (Index) indexes.get( index.getName() );↵ | 1 | UniqueKey current = (UniqueKey) uniqueKeys.get( uniqueKey.getName() );↵ | |
2 | if ( current != null ) {↵ | 2 | if ( current != null ) {↵ | |
3 | throw new MappingException( "Index " + index.getName() + " already exists!" );↵ | 3 | throw new MappingException( "UniqueKey " + uniqueKey.getName() + " already exists!" );↵ | |
4 | }↵ | 4 | }↵ | |
5 | indexes.put( index.getName(), index );↵ | 5 | uniqueKeys.put( uniqueKey.getName(), uniqueKey );↵ | |
6 | return index; | 6 | return uniqueKey; | |
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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 13 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 0.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | UniqueKey current = (UniqueKey)uniqueKeys.get(uniqueKey.getName()); | ||||||||||||||||||||||||||
1 | Index current = (Index)indexes.get(index.getName()); | | ||||||||||||||||||||||||||
2 | if (current != null) |
| 2 | if (current != null) | ||||||||||||||||||||||||
|
| 3 | throw new MappingException("UniqueKey " + uniqueKey.getName() + " already exists!"); | |||||||||||||||||||||||||
3 | throw new MappingException("Index " + index.getName() + " already exists!"); |
| | |||||||||||||||||||||||||
4 | indexes.put(index.getName(), index); |
| 4 | uniqueKeys.put(uniqueKey.getName(), uniqueKey); | ||||||||||||||||||||||||
|
| 5 | return uniqueKey; | |||||||||||||||||||||||||
5 | return index; |
| |
Row | Violation |
---|---|
1 | Type org.hibernate.mapping.Index of variable current does not match with type org.hibernate.mapping.UniqueKey of variable current |
2 | Unmatched throw new MappingException("UniqueKey " + uniqueKey.getName() + " already exists!"); |
3 | Unmatched throw new MappingException("Index " + index.getName() + " already exists!"); |
4 | Type org.hibernate.mapping.Index of variable index does not match with type org.hibernate.mapping.UniqueKey of variable uniqueKey |
5 | Type org.hibernate.mapping.Index of variable index does not match with type org.hibernate.mapping.UniqueKey of variable uniqueKey |
6 | Unmatched return uniqueKey; |
7 | Unmatched return index; |