while ( elements.hasNext() ) { final String element = ( String ) elements.next(); buffer.append( elementTransformer.transform( element ) ); if ( elements.hasNext() ) { buffer.append( template.getSeparator() ); } }
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/dialect/function/DerbyConcatFunction.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/sql/Update.java
Method name: String join(Iterator, StringTransformer, StringJoinTemplate) Method name: String toStatementString()
Number of AST nodes: 5 Number of AST nodes: 5
1
while ( elements.hasNext() ) {
2
			final String element = ( String ) elements.next();
3
			buffer.append( elementTransformer.transform( element
1
final Map.Entry e = (Map.Entry) iter.next();
4
 ) );
2
			if ( conditionsAppended ) {
5
			if ( elements.hasNext() ) {
3
			
6
	
4
	buf.append( " and " );
5
			}
7
			buffer.append( template.getSeparator() );
6
			buf.append( 
8
			}
9
		}
7
e.getKey() ).append( e.getValue() );
8
			conditionsAppended = true;
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 comparisons11
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)1.1
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    3
    final String element = (String)elements.next();
                                                                                                    
    4
    buffer.append(elementTransformer.transform(element));
                                                                                                                    
                                                                                              
    30
    final Map.Entry e = (Map.Entry)iter.next();
    5
    if (elements.hasNext())
    5
    if (elements.hasNext())
    31
    if (conditionsAppended)
    Differences
    Expression1Expression2Difference
    elements.hasNext()conditionsAppendedTYPE_COMPATIBLE_REPLACEMENT
    31
    if (conditionsAppended)
    6
    buffer.append(template.getSeparator());
    6
    buffer.append(template.getSeparator());
    32
    buf.append(" and ");
    Differences
    Expression1Expression2Difference
    template.getSeparator()" and "TYPE_COMPATIBLE_REPLACEMENT
    bufferbufVARIABLE_NAME_MISMATCH
    32
    buf.append(" and ");
                                                                                                    
    33
    buf.append(e.getKey()).append(e.getValue());
                                                            
    34
    conditionsAppended = true;
    Preondition Violations
    Unmatched statement conditionsAppended=true; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    34
    conditionsAppended = true;
    Precondition Violations (1)
    Row Violation
    1Unmatched statement conditionsAppended=true; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted