if ( collection.getCustomSQLDelete() == null ) { sqlDeleteRowString = generateDeleteRowString(); deleteCallable = false; deleteCheckStyle = ExecuteUpdateResultCheckStyle.NONE; } else { sqlDeleteRowString = collection.getCustomSQLDelete(); deleteCallable = collection.isCustomDeleteCallable(); deleteCheckStyle = ExecuteUpdateResultCheckStyle.NONE; }
if ( collection.getCustomSQLDeleteAll() == null ) { sqlDeleteString = generateDeleteString(); deleteAllCallable = false; deleteAllCheckStyle = ExecuteUpdateResultCheckStyle.NONE; } else { sqlDeleteString = collection.getCustomSQLDeleteAll(); deleteAllCallable = collection.isCustomDeleteAllCallable(); deleteAllCheckStyle = ExecuteUpdateResultCheckStyle.NONE; }
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.getCustomSQLDelete() == null ) {
1
if ( collection.getCustomSQLDeleteAll() == null ) {
2
			sqlDeleteRowString = generateDeleteRowString();
2
			sqlDeleteString = generateDeleteString();
3
			deleteCallable = false;
3
			deleteAllCallable = false;
4
			deleteCheckStyle = ExecuteUpdateResultCheckStyle.NONE;
4
			deleteAllCheckStyle = ExecuteUpdateResultCheckStyle.NONE;
5
		}
5
		}
6
		else {
6
		else {
7
			sqlDeleteRowString = collection.getCustomSQLDelete();
7
			sqlDeleteString = collection.getCustomSQLDeleteAll();
8
			deleteCallable = collection.isCustomDeleteCallable();
8
			deleteAllCallable = collection.isCustomDeleteAllCallable();
9
			deleteCheckStyle = ExecuteUpdateResultCheckStyle.NONE;
9
			deleteAllCheckStyle = ExecuteUpdateResultCheckStyle.NONE;
10
		}
10
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.5
Clones locationClones are in the same method
Number of node comparisons51
  1. {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)31.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    154
    if (collection.getCustomSQLDelete() == null)
    154
    if (collection.getCustomSQLDelete() == null)
    161
    if (collection.getCustomSQLDeleteAll() == null)
    Differences
    Expression1Expression2Difference
    getCustomSQLDeletegetCustomSQLDeleteAllMETHOD_INVOCATION_NAME_MISMATCH
    161
    if (collection.getCustomSQLDeleteAll() == null)
    155
    sqlDeleteRowString = generateDeleteRowString();
    155
    sqlDeleteRowString = generateDeleteRowString();
    162
    sqlDeleteString = generateDeleteString();
    Differences
    Expression1Expression2Difference
    sqlDeleteRowStringsqlDeleteStringVARIABLE_NAME_MISMATCH
    generateDeleteRowStringgenerateDeleteStringMETHOD_INVOCATION_NAME_MISMATCH
    162
    sqlDeleteString = generateDeleteString();
    156
    deleteCallable = false;
    156
    deleteCallable = false;
    163
    deleteAllCallable = false;
    Differences
    Expression1Expression2Difference
    deleteCallabledeleteAllCallableVARIABLE_NAME_MISMATCH
    163
    deleteAllCallable = false;
    157
    deleteCheckStyle = ExecuteUpdateResultCheckStyle.NONE;
    157
    deleteCheckStyle = ExecuteUpdateResultCheckStyle.NONE;
    164
    deleteAllCheckStyle = ExecuteUpdateResultCheckStyle.NONE;
    Differences
    Expression1Expression2Difference
    deleteCheckStyledeleteAllCheckStyleVARIABLE_NAME_MISMATCH
    164
    deleteAllCheckStyle = ExecuteUpdateResultCheckStyle.NONE;
    else
    else
    158
    sqlDeleteRowString = collection.getCustomSQLDelete();
    158
    sqlDeleteRowString = collection.getCustomSQLDelete();
    165
    sqlDeleteString = collection.getCustomSQLDeleteAll();
    Differences
    Expression1Expression2Difference
    sqlDeleteRowStringsqlDeleteStringVARIABLE_NAME_MISMATCH
    getCustomSQLDeletegetCustomSQLDeleteAllMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression collection.getCustomSQLDelete() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression collection.getCustomSQLDeleteAll() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    165
    sqlDeleteString = collection.getCustomSQLDeleteAll();
    159
    deleteCallable = collection.isCustomDeleteCallable();
    159
    deleteCallable = collection.isCustomDeleteCallable();
    166
    deleteAllCallable = collection.isCustomDeleteAllCallable();
    Differences
    Expression1Expression2Difference
    deleteCallabledeleteAllCallableVARIABLE_NAME_MISMATCH
    isCustomDeleteCallableisCustomDeleteAllCallableMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression collection.isCustomDeleteCallable() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression collection.isCustomDeleteAllCallable() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    166
    deleteAllCallable = collection.isCustomDeleteAllCallable();
    160
    deleteCheckStyle = ExecuteUpdateResultCheckStyle.NONE;
    160
    deleteCheckStyle = ExecuteUpdateResultCheckStyle.NONE;
    167
    deleteAllCheckStyle = ExecuteUpdateResultCheckStyle.NONE;
    Differences
    Expression1Expression2Difference
    deleteCheckStyledeleteAllCheckStyleVARIABLE_NAME_MISMATCH
    167
    deleteAllCheckStyle = ExecuteUpdateResultCheckStyle.NONE;
    Precondition Violations (4)
    Row Violation
    1Expression collection.getCustomSQLDelete() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression collection.getCustomSQLDeleteAll() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression collection.isCustomDeleteCallable() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression collection.isCustomDeleteAllCallable() cannot be parameterized, because it has dependencies to/from statements that will be extracted