for ( int i = 0; i < entityMetamodel.getPropertySpan(); i++ ) { if ( includeProperty[i] && isPropertyOfTable( i, j ) ) { // this is a property of the table, which we are updating update.addColumns( getPropertyColumnNames(i), propertyColumnUpdateable[i] ); hasColumns = hasColumns || getPropertyColumnSpan( i ) > 0; } }
for ( int i = 0; i < entityMetamodel.getPropertySpan(); i++ ) { if ( includeProperty[i] && isPropertyOfTable( i, j ) ) { // this property belongs on the table and is to be inserted insert.addColumns( getPropertyColumnNames(i), propertyColumnInsertable[i] ); } }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java
Method name: String generateUpdateString(boolean[], int, Object[], boolean) Method name: String generateInsertString(boolean, boolean[], int)
Number of AST nodes: 4 Number of AST nodes: 3
1
for ( int i = 0; i < entityMetamodel.getPropertySpan(); i++ ) {
1
for ( int i = 0; i < entityMetamodel.getPropertySpan(); i++ ) {
2
			if ( includeProperty[i] && isPropertyOfTable( i, j ) ) {
2
			if ( includeProperty[i] && isPropertyOfTable( i, j ) ) {
3
				// this is a property of the table, which we are updating
3
				// this property 
4
				update
4
belongs on the table and is to be inserted
5
.addColumns( getPropertyColumnNames(i), propertyColumnUpdateable[i] );
5
				insert.addColumns( getPropertyColumnNames(i), propertyColumnInsertable[i] );
6
				hasColumns = hasColumns || getPropertyColumnSpan( i ) > 0;
6
			
7
			}
7
}
8
		}
8
		}
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.4
Clones locationClones are declared in the same class
Number of node comparisons7
  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 fragment1
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    6
    for (int i = 0; i < entityMetamodel.getPropertySpan(); i++)
    2
    for (int i = 0; i < entityMetamodel.getPropertySpan(); i++)
    7
    if (includeProperty[i] && isPropertyOfTable(i, j))
    3
    if (includeProperty[i] && isPropertyOfTable(i, j))
                                                                                                                                                            
    4
    insert.addColumns(getPropertyColumnNames(i), propertyColumnInsertable[i]);
    Preondition Violations
    Unmatched statement insert.addColumns(getPropertyColumnNames(i),propertyColumnInsertable[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4
    insert.addColumns(getPropertyColumnNames(i), propertyColumnInsertable[i]);
    8
    update.addColumns(getPropertyColumnNames(i), propertyColumnUpdateable[i]);
    8
    update.addColumns(getPropertyColumnNames(i), propertyColumnUpdateable[i]);
    Preondition Violations
    Unmatched statement update.addColumns(getPropertyColumnNames(i),propertyColumnUpdateable[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                            
    9
    hasColumns = hasColumns || getPropertyColumnSpan(i) > 0;
    9
    hasColumns = hasColumns || getPropertyColumnSpan(i) > 0;
    Preondition Violations
    Unmatched statement hasColumns=hasColumns || getPropertyColumnSpan(i) > 0; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                      
    Precondition Violations (3)
    Row Violation
    1Unmatched statement insert.addColumns(getPropertyColumnNames(i),propertyColumnInsertable[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement update.addColumns(getPropertyColumnNames(i),propertyColumnUpdateable[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement hasColumns=hasColumns || getPropertyColumnSpan(i) > 0; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted