File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/mapping/DenormalizedTable.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/mapping/PersistentClass.java | |||
Method name: Iterator getIndexIterator()
|
Method name: void createPrimaryKey()
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | Index parentIndex = (Index) iter.next();↵ | |||
2 | Index index = new Index();↵ | |||
3 | index.setName( getName() + parentIndex↵ | 1 | PrimaryKey pk = new PrimaryKey();↵ | |
2 | Table table = getTable();↵ | |||
3 | pk.setTable(table);↵ | |||
4 | .getName() );↵ | 4 | pk.setName( PK_ALIAS.toAliasString( table.getName() ) );↵ | |
5 | index.setTable(this);↵ | 5 | table.setPrimaryKey(pk);↵ | |
6 | index.addColumns( parentIndex.getColumnIterator() );↵ | 6 | pk.addColumns( getKey().getColumnIterator() ); | |
7 | indexes.add( 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.0 |
Clones location | Clones are in different classes |
Number of node comparisons | 24 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | Index parentIndex = (Index)iter.next(); |
| 2 | Table table = getTable(); | ||||||||||||||||||||||
5 | Index index = new Index(); |
| 1 | PrimaryKey pk = new PrimaryKey(); | ||||||||||||||||||||||
6 | index.setName(getName() + parentIndex.getName()); |
| 4 | pk.setName(PK_ALIAS.toAliasString(table.getName())); | ||||||||||||||||||||||
7 | index.setTable(this); |
| 3 | pk.setTable(table); | ||||||||||||||||||||||
|
| 5 | table.setPrimaryKey(pk); | |||||||||||||||||||||||
|
| 6 | pk.addColumns(getKey().getColumnIterator()); | |||||||||||||||||||||||
8 | index.addColumns(parentIndex.getColumnIterator()); |
| | |||||||||||||||||||||||
9 | indexes.add(index); |
| |
Row | Violation |
---|---|
1 | Expression getName() + parentIndex.getName() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression PK_ALIAS.toAliasString(table.getName()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression index cannot be unified with expression pk , because common superclass org.hibernate.mapping.RelationalModel does not declare member(s) public void setName(java.lang.String) |
4 | Expression table cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression index cannot be unified with expression pk , because common superclass org.hibernate.mapping.RelationalModel does not declare member(s) public void setTable(org.hibernate.mapping.Table) |
6 | Unmatched statement table.setPrimaryKey(pk); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Unmatched statement pk.addColumns(getKey().getColumnIterator()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
8 | Unmatched statement index.addColumns(parentIndex.getColumnIterator()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
9 | Unmatched statement indexes.add(index); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
10 | Clone fragment #1 returns variables parentIndex, index , while Clone fragment #2 returns variables pk, table |
11 | The refactoring of the clones is infeasible, because classes org.hibernate.mapping.DenormalizedTable and org.hibernate.mapping.PersistentClass do not have a common superclass |