if ( collection.getCustomSQLInsert() == null ) { sqlInsertRowString = generateInsertRowString(); insertCallable = false; insertCheckStyle = ExecuteUpdateResultCheckStyle.COUNT; } else { sqlInsertRowString = collection.getCustomSQLInsert(); insertCallable = collection.isCustomInsertCallable(); insertCheckStyle = collection.getCustomSQLInsertCheckStyle() == null ? ExecuteUpdateResultCheckStyle.determineDefault( collection.getCustomSQLInsert(), insertCallable ) : collection.getCustomSQLInsertCheckStyle(); }
if ( collection.getCustomSQLUpdate() == null ) { sqlUpdateRowString = generateUpdateRowString(); updateCallable = false; updateCheckStyle = ExecuteUpdateResultCheckStyle.COUNT; } else { sqlUpdateRowString = collection.getCustomSQLUpdate(); updateCallable = collection.isCustomUpdateCallable(); updateCheckStyle = collection.getCustomSQLUpdateCheckStyle() == null ? ExecuteUpdateResultCheckStyle.determineDefault( collection.getCustomSQLUpdate(), insertCallable ) : collection.getCustomSQLUpdateCheckStyle(); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java
Method name: void AbstractCollectionPersister(Collection, CollectionRegionAccessStrategy, Configuration, SessionFactoryImplementor) Method name: void AbstractCollectionPersister(Collection, CollectionRegionAccessStrategy, Configuration, SessionFactoryImplementor)
Number of AST nodes: 7 Number of AST nodes: 7
1
if ( collection.getCustomSQLInsert() == null ) {
1
if ( collection.getCustomSQLUpdate() == null ) {
2
			sqlInsertRowString = generateInsertRowString();
2
			sqlUpdateRowString = generateUpdateRowString();
3
			insertCallable = false;
3
			updateCallable = false;
4
			insertCheckStyle = ExecuteUpdateResultCheckStyle.COUNT;
4
			updateCheckStyle = ExecuteUpdateResultCheckStyle.COUNT;
5
		}
5
		}
6
		else {
6
		else {
7
			sqlInsertRowString = collection.getCustomSQLInsert();
7
			sqlUpdateRowString = collection.getCustomSQLUpdate();
8
			insertCallable = collection.isCustomInsertCallable();
8
			updateCallable = collection.isCustomUpdateCallable();
9
			insertCheckStyle = collection.getCustomSQLInsertCheckStyle() == null
9
			updateCheckStyle = collection.getCustomSQLUpdateCheckStyle() == null
10
					? ExecuteUpdateResultCheckStyle.determineDefault( collection.getCustomSQLInsert(), insertCallable )
10
					? ExecuteUpdateResultCheckStyle.determineDefault( collection.getCustomSQLUpdate(), insertCallable )
11
		            : collection.getCustomSQLInsertCheckStyle();
11
		            : collection.getCustomSQLUpdateCheckStyle();
12
		}
12
		}
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.2
Clones locationClones are in the same method
Number of node comparisons52
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)6.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    140
    if (collection.getCustomSQLInsert() == null)
    140
    if (collection.getCustomSQLInsert() == null)
    147
    if (collection.getCustomSQLUpdate() == null)
    Differences
    Expression1Expression2Difference
    getCustomSQLInsertgetCustomSQLUpdateMETHOD_INVOCATION_NAME_MISMATCH
    147
    if (collection.getCustomSQLUpdate() == null)
    141
    sqlInsertRowString = generateInsertRowString();
    141
    sqlInsertRowString = generateInsertRowString();
    148
    sqlUpdateRowString = generateUpdateRowString();
    Differences
    Expression1Expression2Difference
    sqlInsertRowStringsqlUpdateRowStringVARIABLE_NAME_MISMATCH
    generateInsertRowStringgenerateUpdateRowStringMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression sqlInsertRowString is a field being modified, and thus it cannot be parameterized
    Expression sqlUpdateRowString is a field being modified, and thus it cannot be parameterized
    148
    sqlUpdateRowString = generateUpdateRowString();
    142
    insertCallable = false;
    142
    insertCallable = false;
    149
    updateCallable = false;
    Differences
    Expression1Expression2Difference
    insertCallableupdateCallableVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression insertCallable is a field being modified, and thus it cannot be parameterized
    Expression updateCallable is a field being modified, and thus it cannot be parameterized
    149
    updateCallable = false;
    143
    insertCheckStyle = ExecuteUpdateResultCheckStyle.COUNT;
    143
    insertCheckStyle = ExecuteUpdateResultCheckStyle.COUNT;
    150
    updateCheckStyle = ExecuteUpdateResultCheckStyle.COUNT;
    Differences
    Expression1Expression2Difference
    insertCheckStyleupdateCheckStyleVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression insertCheckStyle is a field being modified, and thus it cannot be parameterized
    Expression updateCheckStyle is a field being modified, and thus it cannot be parameterized
    150
    updateCheckStyle = ExecuteUpdateResultCheckStyle.COUNT;
    else
    else
    144
    sqlInsertRowString = collection.getCustomSQLInsert();
    144
    sqlInsertRowString = collection.getCustomSQLInsert();
    151
    sqlUpdateRowString = collection.getCustomSQLUpdate();
    Differences
    Expression1Expression2Difference
    sqlInsertRowStringsqlUpdateRowStringVARIABLE_NAME_MISMATCH
    getCustomSQLInsertgetCustomSQLUpdateMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression sqlInsertRowString is a field being modified, and thus it cannot be parameterized
    Expression sqlUpdateRowString is a field being modified, and thus it cannot be parameterized
    151
    sqlUpdateRowString = collection.getCustomSQLUpdate();
    145
    insertCallable = collection.isCustomInsertCallable();
    145
    insertCallable = collection.isCustomInsertCallable();
    152
    updateCallable = collection.isCustomUpdateCallable();
    Differences
    Expression1Expression2Difference
    insertCallableupdateCallableVARIABLE_NAME_MISMATCH
    isCustomInsertCallableisCustomUpdateCallableMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression insertCallable is a field being modified, and thus it cannot be parameterized
    Expression updateCallable is a field being modified, and thus it cannot be parameterized
    152
    updateCallable = collection.isCustomUpdateCallable();
    146
    insertCheckStyle = collection.getCustomSQLInsertCheckStyle() == null ? ExecuteUpdateResultCheckStyle.determineDefault(collection.getCustomSQLInsert(), insertCallable) : collection.getCustomSQLInsertCheckStyle();
    146
    insertCheckStyle = collection.getCustomSQLInsertCheckStyle() == null ? ExecuteUpdateResultCheckStyle.determineDefault(collection.getCustomSQLInsert(), insertCallable) : collection.getCustomSQLInsertCheckStyle();
    153
    updateCheckStyle = collection.getCustomSQLUpdateCheckStyle() == null ? ExecuteUpdateResultCheckStyle.determineDefault(collection.getCustomSQLUpdate(), insertCallable) : collection.getCustomSQLUpdateCheckStyle();
    Differences
    Expression1Expression2Difference
    insertCheckStyleupdateCheckStyleVARIABLE_NAME_MISMATCH
    getCustomSQLInsertCheckStylegetCustomSQLUpdateCheckStyleMETHOD_INVOCATION_NAME_MISMATCH
    getCustomSQLInsertgetCustomSQLUpdateMETHOD_INVOCATION_NAME_MISMATCH
    getCustomSQLInsertCheckStylegetCustomSQLUpdateCheckStyleMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression insertCheckStyle is a field being modified, and thus it cannot be parameterized
    Expression updateCheckStyle is a field being modified, and thus it cannot be parameterized
    153
    updateCheckStyle = collection.getCustomSQLUpdateCheckStyle() == null ? ExecuteUpdateResultCheckStyle.determineDefault(collection.getCustomSQLUpdate(), insertCallable) : collection.getCustomSQLUpdateCheckStyle();
    Precondition Violations (12)
    Row Violation
    1Expression sqlInsertRowString is a field being modified, and thus it cannot be parameterized
    2Expression sqlUpdateRowString is a field being modified, and thus it cannot be parameterized
    3Expression insertCallable is a field being modified, and thus it cannot be parameterized
    4Expression updateCallable is a field being modified, and thus it cannot be parameterized
    5Expression insertCheckStyle is a field being modified, and thus it cannot be parameterized
    6Expression updateCheckStyle is a field being modified, and thus it cannot be parameterized
    7Expression sqlInsertRowString is a field being modified, and thus it cannot be parameterized
    8Expression sqlUpdateRowString is a field being modified, and thus it cannot be parameterized
    9Expression insertCallable is a field being modified, and thus it cannot be parameterized
    10Expression updateCallable is a field being modified, and thus it cannot be parameterized
    11Expression insertCheckStyle is a field being modified, and thus it cannot be parameterized
    12Expression updateCheckStyle is a field being modified, and thus it cannot be parameterized