File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/collection/PersistentSortedMap.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/sql/DerbyCaseFragment.java | |||
Method name: Serializable snapshot(BasicCollectionPersister, EntityMode)
|
Method name: String toFragmentString()
|
|||
Number of AST nodes: 2 | Number of AST nodes: 3 | |||
1 | while ( iter.hasNext() ) {↵ | |||
1 | Map.Entry e = (Map.Entry) iter.next();↵ | 2 | Map.Entry me = ( Map.Entry ) iter.next();↵ | |
2 | clonedMap.put↵ | 3 | buf.append( " when " )//$NON-NLS-1↵ | |
3 | ( e.getKey(), persister.getElementType().deepCopy↵ | 4 | .append( me.getKey() )↵ | |
5 | .append( " is not null then " )//$NON-NLS-1↵ | |||
4 | ( e.getValue(), entityMode, persister.getFactory() ) ); | 6 | .append( me.getValue() );↵ | |
7 |
| |||
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 | 5 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | Map.Entry e = (Map.Entry)iter.next(); |
| 5 | Map.Entry me = (Map.Entry)iter.next(); | ||||||||||
5 | clonedMap.put(e.getKey(), persister.getElementType().deepCopy(e.getValue(), entityMode, persister.getFactory())); |
| | |||||||||||
|
| 6 | buf.append(" when ").append(me.getKey()).append(" is not null then ").append(me.getValue()); |
Row | Violation |
---|---|
1 | Unmatched statement clonedMap.put(e.getKey(),persister.getElementType().deepCopy(e.getValue(),entityMode,persister.getFactory())); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement buf.append(" when ").append(me.getKey()).append(" is not null then ").append(me.getValue()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | The refactoring of the clones is infeasible, because classes org.hibernate.collection.PersistentSortedMap and org.hibernate.sql.DerbyCaseFragment do not have a common superclass |