if (affectedEntity( querySpaces, entitySpaces )) { if ( persister.hasCache() ) { affectedEntityNames.add( persister.getEntityName() ); } Set roles = session.getFactory().getCollectionRolesByEntityParticipant( persister.getEntityName() ); if ( roles != null ) { affectedCollectionRoles.addAll( roles ); } for ( int y = 0; y < entitySpaces.length; y++ ) { tmpSpaces.add( entitySpaces[y] ); } }
while ( itr.hasNext() ) { final AssignmentSpecification specification = ( AssignmentSpecification ) itr.next(); if ( specification.affectsTable( tableNames[tableIndex] ) ) { affected = true; update.appendAssignmentFragment( specification.getSqlAssignmentFragment() ); if ( specification.getParameters() != null ) { for ( int paramIndex = 0; paramIndex < specification.getParameters().length; paramIndex++ ) { parameterList.add( specification.getParameters()[paramIndex] ); } } } }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/action/BulkOperationCleanupAction.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/hql/ast/exec/MultiTableUpdateExecutor.java
Method name: void BulkOperationCleanupAction(SessionImplementor, Set) Method name: void MultiTableUpdateExecutor(HqlSqlWalker)
Number of AST nodes: 8 Number of AST nodes: 8
1
if (affectedEntity( querySpaces, entitySpaces )) {
1
while ( itr.hasNext() ) {
2
				final AssignmentSpecification specification = ( AssignmentSpecification ) itr.next();
2
				if ( persister.hasCache() ) {
3
				if ( spe
3
					affectedEntityNames.add( persister.getEntityName() );
4
				}
5
				Set roles = session.getFactory().getCollectionRolesByEntityParticipant( persister.getEntityName
4
cification.affectsTable( tableNames[tableIndex] ) ) {
5
					affected = true;
6
() );
6
					update.appendAssignmentFragment( specification.getSqlAssignmentFragment() );
7
				if ( roles != null ) {
7
					if ( 
8
					affectedCollectionRoles.addAll( roles );
9
				}
10
				for ( int y = 0; y < entitySpaces.length; y++ ) {
11
					tmpSpaces.add( entitySpaces[y] );
8
specification.getParameters() != null ) {
9
						for ( int paramIndex = 0; paramIndex < specification.getParameters().length; paramIndex++ ) {
10
							parameterList.add( specification.getParameters()[paramIndex] );
11
						}
12
					}
12
				}
13
				}
13
			}
14
			}
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 different classes
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    13
    Set roles = session.getFactory().getCollectionRolesByEntityParticipant(persister.getEntityName());
                                                                                                                                                                                                            
    14
    if (roles != null)
                                              
    15
    affectedCollectionRoles.addAll(roles);
                                                                                        
    16
    for (int y = 0; y < entitySpaces.length; y++)
    16
    for (int y = 0; y < entitySpaces.length; y++)
    29
    for (int paramIndex = 0; paramIndex < specification.getParameters().length; paramIndex++)
    Differences
    Expression1Expression2Difference
    yparamIndexVARIABLE_NAME_MISMATCH
    yparamIndexVARIABLE_NAME_MISMATCH
    entitySpaces.lengthspecification.getParameters().lengthTYPE_COMPATIBLE_REPLACEMENT
    yparamIndexVARIABLE_NAME_MISMATCH
    29
    for (int paramIndex = 0; paramIndex < specification.getParameters().length; paramIndex++)
    17
    tmpSpaces.add(entitySpaces[y]);
    17
    tmpSpaces.add(entitySpaces[y]);
    Preondition Violations
    Unmatched statement tmpSpaces.add(entitySpaces[y]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                          
                                                                                                                                      
    30
    parameterList.add(specification.getParameters()[paramIndex]);
    Preondition Violations
    Unmatched statement parameterList.add(specification.getParameters()[paramIndex]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    30
    parameterList.add(specification.getParameters()[paramIndex]);
    Precondition Violations (2)
    Row Violation
    1Unmatched statement tmpSpaces.add(entitySpaces[y]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement parameterList.add(specification.getParameters()[paramIndex]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted