while ( entries.hasNext() ) { int offset = 1; Object entry = entries.next(); PreparedStatement st = null; if ( collection.needsInserting( entry, i, elementType ) ) { if ( useBatch ) { if ( st == null ) { if ( callable ) { st = session.getBatcher().prepareBatchCallableStatement( sql ); } else { st = session.getBatcher().prepareBatchStatement( sql ); } } } else { if ( callable ) { st = session.getBatcher().prepareCallableStatement( sql ); } else { st = session.getBatcher().prepareStatement( sql ); } } try { offset += expectation.prepare( st ); //TODO: copy/paste from recreate() offset = writeKey( st, id, offset, session ); if ( hasIdentifier ) { offset = writeIdentifier( st, collection.getIdentifier(entry, i), offset, session ); } if ( hasIndex /*&& !indexIsFormula*/ ) { offset = writeIndex( st, collection.getIndex(entry, i, this), offset, session ); } writeElement(st, collection.getElement(entry), offset, session ); if ( useBatch ) { session.getBatcher().addToBatch( expectation ); } else { expectation.verifyOutcome( st.executeUpdate(), st, -1 ); } collection.afterRowInsert( this, entry, i ); count++; } catch ( SQLException sqle ) { if ( useBatch ) { session.getBatcher().abortBatch( sqle ); } throw sqle; } finally { if ( !useBatch ) { session.getBatcher().closeStatement( st ); } } } i++; }
while ( entries.hasNext() ) { Object entry = entries.next(); if ( collection.needsUpdating( entry, i, elementType ) ) { int offset = 1; if ( useBatch ) { if ( st == null ) { if ( callable ) { st = session.getBatcher().prepareBatchCallableStatement( sql ); } else { st = session.getBatcher().prepareBatchStatement( sql ); } } } else { if ( callable ) { st = session.getBatcher().prepareCallableStatement( sql ); } else { st = session.getBatcher().prepareStatement( sql ); } } try { offset+= expectation.prepare( st ); int loc = writeElement( st, collection.getElement( entry ), offset, session ); if ( hasIdentifier ) { writeIdentifier( st, collection.getIdentifier( entry, i ), loc, session ); } else { loc = writeKey( st, id, loc, session ); if ( hasIndex && !indexContainsFormula ) { writeIndexToWhere( st, collection.getIndex( entry, i, this ), loc, session ); } else { writeElementToWhere( st, collection.getSnapshotElement( entry, i ), loc, session ); } } if ( useBatch ) { session.getBatcher().addToBatch( expectation ); } else { expectation.verifyOutcome( st.executeUpdate(), st, -1 ); } } catch ( SQLException sqle ) { if ( useBatch ) { session.getBatcher().abortBatch( sqle ); } throw sqle; } finally { if ( !useBatch ) { session.getBatcher().closeStatement( st ); } } count++; } i++; }
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/BasicCollectionPersister.java
Method name: void insertRows(PersistentCollection, Serializable, SessionImplementor) Method name: int doUpdateRows(Serializable, PersistentCollection, SessionImplementor)
Number of AST nodes: 27 Number of AST nodes: 26
1
while ( entries.hasNext() ) {
1
while ( entries.hasNext() ) {
2
					int offset = 1;
2
				
3
					Object entry = entries.next();
3
Object entry = entries.next();
4
					PreparedStatement st = null;
4
				
5
					if ( collection.needsInserting( entry, i, elementType ) ) {
5
if ( collection.needsUpdating( entry, i, elementType ) ) {
6
	
6
					int offset = 1;
7
					if ( useBatch ) {
7
					if ( useBatch ) {
8
							if ( st == null ) {
8
						if ( st == null ) {
9
								if ( callable ) {
9
							if ( callable ) {
10
									st = session.getBatcher().prepareBatchCallableStatement( sql );
10
								st = session.getBatcher().prepareBatchCallableStatement( sql );
11
								}
11
							}
12
								else {
12
							else {
13
									st = session.getBatcher().prepareBatchStatement( sql );
13
								st = session.getBatcher().prepareBatchStatement( sql );
14
								}
14
							}
15
							}
15
						}
16
						}
16
					}
17
						else {
17
					else {
18
							if ( callable ) {
18
						if ( callable ) {
19
								st = session.getBatcher().prepareCallableStatement( sql );
19
							st = session.getBatcher().prepareCallableStatement( sql );
20
							}
20
						}
21
							else {
21
						else {
22
								st = session.getBatcher().prepareStatement( sql );
22
							st = session.getBatcher().prepareStatement( sql );
23
							}
23
						}
24
						}
24
					}
25
						try {
25
					try {
26
							offset += expectation.prepare( st );
26
						offset+= expectation.prepare( st );
27
							//TODO: copy/paste from recreate()
27
						
28
							offset = writeKey( st, id, offset, session );
28
int loc = writeElement( st, collection.getElement( entry ), offset, session );
29
							if ( hasIdentifier ) {
29
						if ( hasIdentifier ) {
30
								offset = writeIdentifier( st, collection.getIdentifier(entry, i), offset, session );
30
							writeIdentifier( st, collection.getIdentifier( entry, i ), loc, session );
31
							}
31
						}
32
						else {
33
							loc = writeKey( st, id, loc, session );
32
							if ( hasIndex /*&& !indexIsFormula*/ ) {
34
							if ( hasIndex && !indexContainsFormula ) {
33
								offset = writeIndex( st, collection.getIndex(entry, i, this), offset, session );
35
								writeIndexToWhere( st, collection.getIndex( entry, i, this ), loc, session );
34
							}
36
							}
35
							
37
							else {
36
writeElement(st, collection.getElement(entry), offset, session );
38
								writeElementToWhere( st, collection.getSnapshotElement( entry, i ), loc, session );
37
			
39
							}
40
						}
38
				if ( useBatch ) {
41
						if ( useBatch ) {
39
								session.getBatcher().addToBatch( expectation );
42
							session.getBatcher().addToBatch( expectation );
40
							}
43
						}
41
							else {
44
						else {
42
								expectation.verifyOutcome( st.executeUpdate(), st, -1 );
45
							expectation.verifyOutcome( st.executeUpdate(), st, -1 );
43
							}
46
						}
44
							collection.afterRowInsert( this, entry, i );
47
					
45
							count++;
46
						}
48
}
47
						catch ( SQLException sqle ) {
49
					catch ( SQLException sqle ) {
48
							if ( useBatch ) {
50
						if ( useBatch ) {
49
								session.getBatcher().abortBatch( sqle );
51
							session.getBatcher().abortBatch( sqle );
50
							}
52
						}
51
							throw sqle;
53
						throw sqle;
52
						}
54
					}
53
						finally {
55
					finally {
54
							if ( !useBatch ) {
56
						if ( !useBatch ) {
55
								session.getBatcher().closeStatement( st );
57
							session.getBatcher().closeStatement( st );
56
							}
58
						}
57
						}
59
					}
58
					
60
					count++;
59
}
61
				}
60
					i++;
62
				i++;
61
				}
63
			}
Summary
Number of common nesting structure subtrees2
Number of refactorable cases0
Number of non-refactorable cases2
Time elapsed for finding largest common nesting structure subtrees (ms)3.7
Clones locationClones are in different classes having the same super class
Number of node comparisons100
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment17
    Number of unmapped statements in the second code fragment16
    Time elapsed for statement mapping (ms)33.1
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    13
    while (entries.hasNext())
    12
    while (entries.hasNext())
    14
    int offset = 1;
    14
    int offset = 1;
    Preondition Violations
    Unmatched statement int offset=1; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                      
    15
    Object entry = entries.next();
    13
    Object entry = entries.next();
    16
    PreparedStatement st = null;
    16
    PreparedStatement st = null;
    Preondition Violations
    Unmatched statement PreparedStatement st=null; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                
    17
    if (collection.needsInserting(entry, i, elementType))
    17
    if (collection.needsInserting(entry, i, elementType))
    14
    if (collection.needsUpdating(entry, i, elementType))
    Differences
    Expression1Expression2Difference
    needsInsertingneedsUpdatingMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression collection.needsInserting(entry,i,elementType) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression collection.needsUpdating(entry,i,elementType) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14
    if (collection.needsUpdating(entry, i, elementType))
                                      
    15
    int offset = 1;
    18
    if (useBatch)
    16
    if (useBatch)
    19
    if (st == null)
    17
    if (st == null)
    20
    if (callable)
    18
    if (callable)
    21
    st = session.getBatcher().prepareBatchCallableStatement(sql);
    19
    st = session.getBatcher().prepareBatchCallableStatement(sql);
    else
            
                                                                                                                  
    20
    st = session.getBatcher().prepareBatchStatement(sql);
    Preondition Violations
    Unmatched statement st=session.getBatcher().prepareBatchStatement(sql); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement st=session.getBatcher().prepareBatchStatement(sql); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    20
    st = session.getBatcher().prepareBatchStatement(sql);
    22
    st = session.getBatcher().prepareBatchStatement(sql);
    22
    st = session.getBatcher().prepareBatchStatement(sql);
    Preondition Violations
    Unmatched statement st=session.getBatcher().prepareBatchStatement(sql); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement st=session.getBatcher().prepareBatchStatement(sql); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                                                                  
    else
    else
    23
    if (callable)
    21
    if (callable)
    24
    st = session.getBatcher().prepareCallableStatement(sql);
    22
    st = session.getBatcher().prepareCallableStatement(sql);
    else
            
                                                                                                        
    23
    st = session.getBatcher().prepareStatement(sql);
    Preondition Violations
    Unmatched statement st=session.getBatcher().prepareStatement(sql); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement st=session.getBatcher().prepareStatement(sql); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    23
    st = session.getBatcher().prepareStatement(sql);
    25
    st = session.getBatcher().prepareStatement(sql);
    25
    st = session.getBatcher().prepareStatement(sql);
    Preondition Violations
    Unmatched statement st=session.getBatcher().prepareStatement(sql); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement st=session.getBatcher().prepareStatement(sql); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                                                        
                  
    24
    try
    Preondition Violations
    Unmatched statement try cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    24
    try
                                                                            
    25
    offset += expectation.prepare(st);
    Preondition Violations
    Unmatched statement offset+=expectation.prepare(st); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement offset+=expectation.prepare(st); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    25
    offset += expectation.prepare(st);
                                                                                                                                                      
    26
    int loc = writeElement(st, collection.getElement(entry), offset, session);
    Preondition Violations
    Unmatched statement int loc=writeElement(st,collection.getElement(entry),offset,session); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement int loc=writeElement(st,collection.getElement(entry),offset,session); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    26
    int loc = writeElement(st, collection.getElement(entry), offset, session);
                                              
    27
    if (hasIdentifier)
                                                                                                                                                
    28
    writeIdentifier(st, collection.getIdentifier(entry, i), loc, session);
    Preondition Violations
    Unmatched statement writeIdentifier(st,collection.getIdentifier(entry,i),loc,session); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    28
    writeIdentifier(st, collection.getIdentifier(entry, i), loc, session);
            
    else
                                                                            
    29
    loc = writeKey(st, id, loc, session);
    Preondition Violations
    Unmatched statement loc=writeKey(st,id,loc,session); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    29
    loc = writeKey(st, id, loc, session);
                                                                                      
    30
    if (hasIndex && !indexContainsFormula)
                                                                                                                                                    
    31
    writeIndexToWhere(st, collection.getIndex(entry, i, this), loc, session);
    Preondition Violations
    Unmatched statement writeIndexToWhere(st,collection.getIndex(entry,i,this),loc,session); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    31
    writeIndexToWhere(st, collection.getIndex(entry, i, this), loc, session);
            
    else
                                                                                                                                                                  
    32
    writeElementToWhere(st, collection.getSnapshotElement(entry, i), loc, session);
    Preondition Violations
    Unmatched statement writeElementToWhere(st,collection.getSnapshotElement(entry,i),loc,session); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    32
    writeElementToWhere(st, collection.getSnapshotElement(entry, i), loc, session);
                                    
    33
    if (useBatch)
                                                                                                      
    34
    session.getBatcher().addToBatch(expectation);
    Preondition Violations
    Unmatched statement session.getBatcher().addToBatch(expectation); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    34
    session.getBatcher().addToBatch(expectation);
            
    else
                                                                                                                    
    35
    expectation.verifyOutcome(st.executeUpdate(), st, -1);
    Preondition Violations
    Unmatched statement expectation.verifyOutcome(st.executeUpdate(),st,-1); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    35
    expectation.verifyOutcome(st.executeUpdate(), st, -1);
    26
    try
    26
    try
    Preondition Violations
    Unmatched statement try cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                  
    27
    offset += expectation.prepare(st);
    27
    offset += expectation.prepare(st);
    Preondition Violations
    Unmatched statement offset+=expectation.prepare(st); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement offset+=expectation.prepare(st); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                            
    28
    offset = writeKey(st, id, offset, session);
    28
    offset = writeKey(st, id, offset, session);
    Preondition Violations
    Unmatched statement offset=writeKey(st,id,offset,session); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement offset=writeKey(st,id,offset,session); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                                        
    29
    if (hasIdentifier)
                                              
    30
    offset = writeIdentifier(st, collection.getIdentifier(entry, i), offset, session);
    30
    offset = writeIdentifier(st, collection.getIdentifier(entry, i), offset, session);
    Preondition Violations
    Unmatched statement offset=writeIdentifier(st,collection.getIdentifier(entry,i),offset,session); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                                    
    31
    if (hasIndex)
                                    
    32
    offset = writeIndex(st, collection.getIndex(entry, i, this), offset, session);
    32
    offset = writeIndex(st, collection.getIndex(entry, i, this), offset, session);
    Preondition Violations
    Unmatched statement offset=writeIndex(st,collection.getIndex(entry,i,this),offset,session); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                          
    33
    writeElement(st, collection.getElement(entry), offset, session);
    33
    writeElement(st, collection.getElement(entry), offset, session);
    Preondition Violations
    Unmatched statement writeElement(st,collection.getElement(entry),offset,session); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement writeElement(st,collection.getElement(entry),offset,session); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                                                                                      
    34
    if (useBatch)
                                    
    35
    session.getBatcher().addToBatch(expectation);
    35
    session.getBatcher().addToBatch(expectation);
    Preondition Violations
    Unmatched statement session.getBatcher().addToBatch(expectation); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                      
    else
            
    36
    expectation.verifyOutcome(st.executeUpdate(), st, -1);
    36
    expectation.verifyOutcome(st.executeUpdate(), st, -1);
    Preondition Violations
    Unmatched statement expectation.verifyOutcome(st.executeUpdate(),st,-1); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                    
    37
    collection.afterRowInsert(this, entry, i);
    37
    collection.afterRowInsert(this, entry, i);
    Preondition Violations
    Unmatched statement collection.afterRowInsert(this,entry,i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement collection.afterRowInsert(this,entry,i); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                                            
    38
    count++;
    38
    count++;
    Preondition Violations
    Unmatched statement count++; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                            
                            
    36
    count++;
    Preondition Violations
    Unmatched statement count++; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    36
    count++;
    39
    i++;
    37
    i++;
    Precondition Violations (39)
    Row Violation
    1Unmatched statement int offset=1; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement PreparedStatement st=null; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Expression collection.needsInserting(entry,i,elementType) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression collection.needsUpdating(entry,i,elementType) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Unmatched statement st=session.getBatcher().prepareBatchStatement(sql); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched statement st=session.getBatcher().prepareBatchStatement(sql); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    7Unmatched statement st=session.getBatcher().prepareBatchStatement(sql); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8Unmatched statement st=session.getBatcher().prepareBatchStatement(sql); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    9Unmatched statement st=session.getBatcher().prepareStatement(sql); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    10Unmatched statement st=session.getBatcher().prepareStatement(sql); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    11Unmatched statement st=session.getBatcher().prepareStatement(sql); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    12Unmatched statement st=session.getBatcher().prepareStatement(sql); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    13Unmatched statement try cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    14Unmatched statement offset+=expectation.prepare(st); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    15Unmatched statement offset+=expectation.prepare(st); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    16Unmatched statement int loc=writeElement(st,collection.getElement(entry),offset,session); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    17Unmatched statement int loc=writeElement(st,collection.getElement(entry),offset,session); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    18Unmatched statement writeIdentifier(st,collection.getIdentifier(entry,i),loc,session); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    19Unmatched statement loc=writeKey(st,id,loc,session); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    20Unmatched statement writeIndexToWhere(st,collection.getIndex(entry,i,this),loc,session); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    21Unmatched statement writeElementToWhere(st,collection.getSnapshotElement(entry,i),loc,session); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    22Unmatched statement session.getBatcher().addToBatch(expectation); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    23Unmatched statement expectation.verifyOutcome(st.executeUpdate(),st,-1); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    24Unmatched statement try cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    25Unmatched statement offset+=expectation.prepare(st); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    26Unmatched statement offset+=expectation.prepare(st); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    27Unmatched statement offset=writeKey(st,id,offset,session); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    28Unmatched statement offset=writeKey(st,id,offset,session); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    29Unmatched statement offset=writeIdentifier(st,collection.getIdentifier(entry,i),offset,session); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    30Unmatched statement offset=writeIndex(st,collection.getIndex(entry,i,this),offset,session); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    31Unmatched statement writeElement(st,collection.getElement(entry),offset,session); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    32Unmatched statement writeElement(st,collection.getElement(entry),offset,session); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    33Unmatched statement session.getBatcher().addToBatch(expectation); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    34Unmatched statement expectation.verifyOutcome(st.executeUpdate(),st,-1); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    35Unmatched statement collection.afterRowInsert(this,entry,i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    36Unmatched statement collection.afterRowInsert(this,entry,i); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    37Unmatched statement count++; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    38Unmatched statement count++; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    39Clone fragment #1 returns variables st, entry, i , while Clone fragment #2 returns variables st, entry, i
  2. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment5
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)3.5
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    27
    offset += expectation.prepare(st);
                                                                            
    28
    offset = writeKey(st, id, offset, session);
    28
    offset = writeKey(st, id, offset, session);
    Preondition Violations
    Unmatched statement offset=writeKey(st,id,offset,session); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                        
    33
    writeElement(st, collection.getElement(entry), offset, session);
    33
    writeElement(st, collection.getElement(entry), offset, session);
    Preondition Violations
    Unmatched statement writeElement(st,collection.getElement(entry),offset,session); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                      
    34
    if (useBatch)
    34
    if (useBatch)
    18
    if (callable)
    Differences
    Expression1Expression2Difference
    useBatchcallableVARIABLE_NAME_MISMATCH
    18
    if (callable)
                                                                                                                                  
    19
    st = session.getBatcher().prepareBatchCallableStatement(sql);
    Preondition Violations
    Unmatched statement st=session.getBatcher().prepareBatchCallableStatement(sql); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement st=session.getBatcher().prepareBatchCallableStatement(sql); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    19
    st = session.getBatcher().prepareBatchCallableStatement(sql);
    35
    session.getBatcher().addToBatch(expectation);
    35
    session.getBatcher().addToBatch(expectation);
    Preondition Violations
    Unmatched statement session.getBatcher().addToBatch(expectation); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement session.getBatcher().addToBatch(expectation); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                                                      
    else
            
                                                                                                                  
    20
    st = session.getBatcher().prepareBatchStatement(sql);
    Preondition Violations
    Unmatched statement st=session.getBatcher().prepareBatchStatement(sql); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement st=session.getBatcher().prepareBatchStatement(sql); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    20
    st = session.getBatcher().prepareBatchStatement(sql);
    36
    expectation.verifyOutcome(st.executeUpdate(), st, -1);
    36
    expectation.verifyOutcome(st.executeUpdate(), st, -1);
    Preondition Violations
    Unmatched statement expectation.verifyOutcome(st.executeUpdate(),st,-1); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                                                                    
    Precondition Violations (10)
    Row Violation
    1Unmatched statement offset=writeKey(st,id,offset,session); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement writeElement(st,collection.getElement(entry),offset,session); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement st=session.getBatcher().prepareBatchCallableStatement(sql); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement st=session.getBatcher().prepareBatchCallableStatement(sql); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    5Unmatched statement session.getBatcher().addToBatch(expectation); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched statement session.getBatcher().addToBatch(expectation); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    7Unmatched statement st=session.getBatcher().prepareBatchStatement(sql); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    8Unmatched statement st=session.getBatcher().prepareBatchStatement(sql); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    9Unmatched statement expectation.verifyOutcome(st.executeUpdate(),st,-1); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    10The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero