Map.Entry e = (Map.Entry) iter.next(); buf.append( e.getKey() ).append( '=' ).append( e.getValue() ); if ( iter.hasNext() ) { buf.append( ", " ); } assignmentsAppended = true;
while ( iter.hasNext() ) { final Map.Entry e = (Map.Entry) iter.next(); if ( conditionsAppended ) { buf.append( " and " ); } buf.append( e.getKey() ).append( e.getValue() ); conditionsAppended = true; }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/sql/Update.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/sql/Update.java
Method name: String toStatementString() Method name: String toStatementString()
Number of AST nodes: 5 Number of AST nodes: 6
1
while ( iter.hasNext() ) {
1
Map.Entry e = (Map.Entry) iter.next();
2
			final Map.Entry e = (Map.Entry) iter.next();
2
			buf.append( e.getKey() ).append( '=' ).append( e.getValue() );
3
			
3
			if ( iter.hasNext() ) {
4
				buf.append( ", " );
5
			}
6
			assignment
4
if ( conditionsAppended ) {
5
				buf.append( " and " );
6
			}
7
			buf.append( e.getKey() ).append( e.getValue() );
7
sAppended = true;
8
			conditionsAppended = true;
9
		}
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 the same method
Number of node comparisons14
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)1.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    8
    Map.Entry e = (Map.Entry)iter.next();
                                                                                
    9
    buf.append(e.getKey()).append('=').append(e.getValue());
                                                                                                                          
                                                                                              
    30
    final Map.Entry e = (Map.Entry)iter.next();
    10
    if (iter.hasNext())
    10
    if (iter.hasNext())
    31
    if (conditionsAppended)
    Differences
    Expression1Expression2Difference
    iter.hasNext()conditionsAppendedTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression conditionsAppended cannot be parameterized, because it has dependencies to/from statements that will be extracted
    31
    if (conditionsAppended)
    11
    buf.append(", ");
    11
    buf.append(", ");
    32
    buf.append(" and ");
    Differences
    Expression1Expression2Difference
    ", "" and "LITERAL_VALUE_MISMATCH
    32
    buf.append(" and ");
                                                                                                    
    33
    buf.append(e.getKey()).append(e.getValue());
    12
    assignmentsAppended = true;
    12
    assignmentsAppended = true;
    34
    conditionsAppended = true;
    Differences
    Expression1Expression2Difference
    assignmentsAppendedconditionsAppendedVARIABLE_NAME_MISMATCH
    34
    conditionsAppended = true;
    Precondition Violations (1)
    Row Violation
    1Expression conditionsAppended cannot be parameterized, because it has dependencies to/from statements that will be extracted