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: UniqueKey getOrCreateUniqueKey(String)
|
Method name: Index getOrCreateIndex(String)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | UniqueKey uk = (UniqueKey) uniqueKeys.get( keyName );↵ | 1 | Index index = (Index) indexes.get( indexName );↵ | |
2 | if ( uk == null ) {↵ | 2 | if ( index == null ) {↵ | |
3 | uk = new UniqueKey();↵ | 3 | index = new Index();↵ | |
4 | uk.setName( keyName );↵ | 4 | index.setName( indexName );↵ | |
5 | uk.setTable( this );↵ | 5 | index.setTable( this );↵ | |
6 | uniqueKeys.put( keyName, uk );↵ | 6 | indexes.put( indexName, index );↵ | |
7 | }↵ | 7 | }↵ | |
8 | return uk; | 8 | return index; | |
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 | 29 |
Number of mapped statements | 4 |
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) | 1.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Index index = (Index)indexes.get(indexName); | ||||||||||||||||||||||
1 | UniqueKey uk = (UniqueKey)uniqueKeys.get(keyName); | | ||||||||||||||||||||||
2 | if (uk == null) |
| 2 | if (index == null) | ||||||||||||||||||||
|
| 3 | index = new Index(); | |||||||||||||||||||||
3 | uk = new UniqueKey(); |
| | |||||||||||||||||||||
4 | uk.setName(keyName); |
| 4 | index.setName(indexName); | ||||||||||||||||||||
5 | uk.setTable(this); |
| 5 | index.setTable(this); | ||||||||||||||||||||
6 | uniqueKeys.put(keyName, uk); |
| 6 | indexes.put(indexName, index); | ||||||||||||||||||||
|
| 7 | return index; | |||||||||||||||||||||
7 | return uk; |
| |
Row | Violation |
---|---|
1 | Type org.hibernate.mapping.UniqueKey of variable uk does not match with type org.hibernate.mapping.Index of variable index |
2 | Unmatched statement index=new Index(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement uk=new UniqueKey(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Type org.hibernate.mapping.UniqueKey of variable uk does not match with type org.hibernate.mapping.Index of variable index |
5 | Type org.hibernate.mapping.UniqueKey of variable uk does not match with type org.hibernate.mapping.Index of variable index |
6 | Type org.hibernate.mapping.UniqueKey of variable uk does not match with type org.hibernate.mapping.Index of variable index |
7 | Unmatched return index; |
8 | Unmatched return uk; |