CriteriaImpl.OrderEntry oe = ( CriteriaImpl.OrderEntry ) criterionIterator.next(); orderBy.append( oe.getOrder().toSqlString( oe.getCriteria(), this ) ); if ( criterionIterator.hasNext() ) { orderBy.append( ", " ); }
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/loader/criteria/CriteriaQueryTranslator.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/sql/Update.java
Method name: String getOrderBy() Method name: String toStatementString()
Number of AST nodes: 4 Number of AST nodes: 5
1
CriteriaImpl.OrderEntry oe = ( CriteriaImpl.OrderEntry ) criterionIterator.next();
1
final Map.Entry e = (Map.Entry) iter.next();
2
			orderBy.append( oe.getOrder().toSqlString
2
			if ( conditionsAppended ) {
3
				buf.append( " and " );
4
			}
3
( oe.getCriteria(), this ) );
5
			buf.append( e.getKey() ).append( e.get
4
			if ( criterionIterator.hasNext() ) {
5
				orderBy.append( ", " );
6
			}
6
Value() );
7
			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.7
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    4
    CriteriaImpl.OrderEntry oe = (CriteriaImpl.OrderEntry)criterionIterator.next();
                                                                                                                                                                    
    5
    orderBy.append(oe.getOrder().toSqlString(oe.getCriteria(), this));
                                                                                                                                            
                                                                                              
    30
    final Map.Entry e = (Map.Entry)iter.next();
    6
    if (criterionIterator.hasNext())
    6
    if (criterionIterator.hasNext())
    31
    if (conditionsAppended)
    Differences
    Expression1Expression2Difference
    criterionIterator.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)
    7
    orderBy.append(", ");
    7
    orderBy.append(", ");
    32
    buf.append(" and ");
    Differences
    Expression1Expression2Difference
    ", "" and "LITERAL_VALUE_MISMATCH
    orderBybufVARIABLE_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 (2)
    Row Violation
    1Expression conditionsAppended cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Unmatched statement conditionsAppended=true; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted