if ( where == null ) { where = fragment; } else { where += ( " and " + fragment ); } return this;
if ( assignments == null ) { assignments = fragment; } else { assignments += ", " + fragment; } return this;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/sql/Delete.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/sql/Update.java
Method name: Delete addWhereFragment(String) Method name: Update appendAssignmentFragment(String)
Number of AST nodes: 4 Number of AST nodes: 4
1
if ( where == null ) {
1
if ( assignments == null ) {
2
			where = fragment;
2
			assignments = fragment;
3
		}
3
		}
4
		else {
4
		else {
5
			where += ( " and " + fragment );
5
			assignments += ", " + fragment;
6
		}
6
		}
7
		return this;
7
		return this;
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 comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    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.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (where == null)
    1
    if (where == null)
    1
    if (assignments == null)
    Differences
    Expression1Expression2Difference
    whereassignmentsVARIABLE_NAME_MISMATCH
    1
    if (assignments == null)
    2
    where = fragment;
    2
    where = fragment;
    2
    assignments = fragment;
    Differences
    Expression1Expression2Difference
    whereassignmentsVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression where is a field being modified, and thus it cannot be parameterized
    Expression assignments is a field being modified, and thus it cannot be parameterized
    2
    assignments = fragment;
    else
    else
    3
    where += (" and " + fragment);
    3
    where += (" and " + fragment);
    3
    assignments += ", " + fragment;
    Differences
    Expression1Expression2Difference
    whereassignmentsVARIABLE_NAME_MISMATCH
    (" and " + fragment)", " + fragmentTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression where is a field being modified, and thus it cannot be parameterized
    Expression assignments is a field being modified, and thus it cannot be parameterized
    3
    assignments += ", " + fragment;
                                  
    4
    return this;
    Preondition Violations
    Unmatched return this;
    4
    return this;
    4
    return this;
    4
    return this;
    Preondition Violations
    Unmatched return this;
                                  
    Precondition Violations (6)
    Row Violation
    1Expression where is a field being modified, and thus it cannot be parameterized
    2Expression assignments is a field being modified, and thus it cannot be parameterized
    3Expression where is a field being modified, and thus it cannot be parameterized
    4Expression assignments is a field being modified, and thus it cannot be parameterized
    5Unmatched return this;
    6Unmatched return this;