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.3
Clones locationClones are in the same method
Number of node comparisons40
  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)37.2
    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
    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
    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 collection.getCustomSQLInsert() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression collection.getCustomSQLUpdate() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    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
    Expression collection.isCustomInsertCallable() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression collection.isCustomUpdateCallable() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    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 collection.getCustomSQLInsertCheckStyle() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression collection.getCustomSQLUpdateCheckStyle() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression collection.getCustomSQLInsert() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression collection.getCustomSQLUpdate() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression collection.getCustomSQLInsertCheckStyle() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression collection.getCustomSQLUpdateCheckStyle() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    153
    updateCheckStyle = collection.getCustomSQLUpdateCheckStyle() == null ? ExecuteUpdateResultCheckStyle.determineDefault(collection.getCustomSQLUpdate(), insertCallable) : collection.getCustomSQLUpdateCheckStyle();
    Precondition Violations (14)
    Row Violation
    1Expression insertCallable is a field being modified, and thus it cannot be parameterized
    2Expression updateCallable is a field being modified, and thus it cannot be parameterized
    3Expression collection.getCustomSQLInsert() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression collection.getCustomSQLUpdate() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression insertCallable is a field being modified, and thus it cannot be parameterized
    6Expression updateCallable is a field being modified, and thus it cannot be parameterized
    7Expression collection.isCustomInsertCallable() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression collection.isCustomUpdateCallable() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression collection.getCustomSQLInsertCheckStyle() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression collection.getCustomSQLUpdateCheckStyle() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression collection.getCustomSQLInsert() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression collection.getCustomSQLUpdate() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression collection.getCustomSQLInsertCheckStyle() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression collection.getCustomSQLUpdateCheckStyle() cannot be parameterized, because it has dependencies to/from statements that will be extracted