initialize( true ); Iterator itr = puts.entrySet().iterator(); while ( itr.hasNext() ) { Map.Entry entry = ( Entry ) itr.next(); put( entry.getKey(), entry.getValue() ); }
StringBuffer buffer = new StringBuffer(); Iterator itr = paramSpecs.iterator(); while ( itr.hasNext() ) { buffer.append( ( ( ParameterSpecification ) itr.next() ).renderDisplayInfo() ); } return buffer.toString();
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/collection/PersistentMap.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/hql/ast/tree/IndexNode.java
Method name: void putAll(Map) Method name: String collectDisplayInfo()
Number of AST nodes: 5 Number of AST nodes: 5
1
initialize( true );
1
StringBuffer buffer = new StringBuffer();
2
			Iterator itr = puts.entrySet().iterator();
2
			Iterator itr = paramSpecs.iterator();
3
			while ( itr.hasNext() ) {
3
			while ( itr.hasNext() ) {
4
				Map.Entry entry = ( Entry ) itr.next();
4
				
5
				put( entry.getKey(), entry.getValue() );
6
			}
5
buffer.append( ( ( ParameterSpecification ) itr.next() ).renderDisplayInfo() );
6
			}
7
			return buffer.toString();
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.1
Clones locationClones are in different classes
Number of node comparisons12
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)1.4
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                        
    1
    StringBuffer buffer = new StringBuffer();
    2
    initialize(true);
    2
    initialize(true);
    Preondition Violations
    Unmatched statement initialize(true); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                            
    3
    Iterator itr = puts.entrySet().iterator();
    3
    Iterator itr = puts.entrySet().iterator();
    2
    Iterator itr = paramSpecs.iterator();
    Differences
    Expression1Expression2Difference
    java.util.Setjava.util.ListSUBCLASS_TYPE_MISMATCH
    puts.entrySet()paramSpecsTYPE_COMPATIBLE_REPLACEMENT
    2
    Iterator itr = paramSpecs.iterator();
    4
    while (itr.hasNext())
    3
    while (itr.hasNext())
                                                                                                                                                          
    4
    buffer.append(((ParameterSpecification)itr.next()).renderDisplayInfo());
    Preondition Violations
    Unmatched statement buffer.append(((ParameterSpecification)itr.next()).renderDisplayInfo()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4
    buffer.append(((ParameterSpecification)itr.next()).renderDisplayInfo());
    5
    Map.Entry entry = (Entry)itr.next();
    5
    Map.Entry entry = (Entry)itr.next();
    Preondition Violations
    Unmatched statement Map.Entry entry=(Entry)itr.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                              
    6
    put(entry.getKey(), entry.getValue());
    6
    put(entry.getKey(), entry.getValue());
    Preondition Violations
    Unmatched statement put(entry.getKey(),entry.getValue()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                                    
                                                            
    5
    return buffer.toString();
    Preondition Violations
    Unmatched return buffer.toString();
    5
    return buffer.toString();
    Precondition Violations (6)
    Row Violation
    1Unmatched statement initialize(true); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement buffer.append(((ParameterSpecification)itr.next()).renderDisplayInfo()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement Map.Entry entry=(Entry)itr.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement put(entry.getKey(),entry.getValue()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    5Unmatched return buffer.toString();
    6The refactoring of the clones is infeasible, because classes org.hibernate.collection.PersistentMap and org.hibernate.hql.ast.tree.IndexNode.AggregatedIndexCollectionSelectorParameterSpecifications do not have a common superclass