Map.Entry e = (Map.Entry) iter.next(); clonedMap.put( e.getKey(), persister.getElementType().deepCopy( e.getValue(), entityMode, persister.getFactory() ) );
while ( iter.hasNext() ) { Map.Entry me = (Map.Entry) iter.next(); buf.append(" when ") .append( me.getKey() ) .append(" is not null then ") .append( me.getValue() ); }
Clone fragments detected by clone detection tool
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/ANSICaseFragment.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 ")
3
( e.getKey(), persister.getElementType().deepCopy
4
				.append( me.getKey() )
5
				.append(" is not null then ")
4
( e.getValue(), entityMode, persister.getFactory() ) );
6
				.append( me.getValue() );
7
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are in different classes
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    Map.Entry e = (Map.Entry)iter.next();
    4
    Map.Entry e = (Map.Entry)iter.next();
    4
    Map.Entry me = (Map.Entry)iter.next();
    Differences
    Expression1Expression2Difference
    emeVARIABLE_NAME_MISMATCH
    4
    Map.Entry me = (Map.Entry)iter.next();
                                                                                                                                                                                                  
    5
    buf.append(" when ").append(me.getKey()).append(" is not null then ").append(me.getValue());
    Preondition Violations
    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
    5
    buf.append(" when ").append(me.getKey()).append(" is not null then ").append(me.getValue());
    5
    clonedMap.put(e.getKey(), persister.getElementType().deepCopy(e.getValue(), entityMode, persister.getFactory()));
    5
    clonedMap.put(e.getKey(), persister.getElementType().deepCopy(e.getValue(), entityMode, persister.getFactory()));
    Preondition Violations
    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
                                                                                                                                                                                                                                      
    Precondition Violations (3)
    Row Violation
    1Unmatched 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
    2Unmatched 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
    3The refactoring of the clones is infeasible, because classes org.hibernate.collection.PersistentSortedMap and org.hibernate.sql.ANSICaseFragment do not have a common superclass