try { s = openSession(); txn = s.beginTransaction(); s.update(item); txn.commit(); s.close(); fail("expected stale write to fail"); } catch (Throwable expected) { // expected behavior here if (txn != null) { try { txn.rollback(); } catch (Throwable ignore) { } } } finally { if (s != null && s.isOpen()) { try { s.close(); } catch (Throwable ignore) {
try { s = openSession(); txn = s.beginTransaction(); s.update( item ); txn.commit(); s.close(); fail( "expected stale write to fail" ); } catch( Throwable expected ) { // expected behavior here if ( txn != null ) { try { txn.rollback(); } catch( Throwable ignore ) { } } } finally { if ( s != null && s.isOpen() ) { try { s.close(); } catch( Throwable ignore ) {
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/functional/AbstractEntityCacheFunctionalTestCase.java File path: /hibernate-distribution-3.3.2.GA/project/testing/src/main/java/org/hibernate/test/cache/BaseCacheProviderTestCase.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
try {
1
try {
2
            s = openSession();
2
			s = openSession();
3
            txn = s.beginTransaction();
3
			txn = s.beginTransaction();
4
            s.update(item);
4
			s.update( item );
5
            txn.commit();
5
			txn.commit();
6
            s.close();
7
            
6
			s.close();
8
fail("expected stale write to fail");
7
			fail( "expected stale write to fail" );
9
        } 
8
		}
10
catch (Throwable expected) {
9
		catch( Throwable expected ) {
11
            // expected behavior here
10
			// expected behavior here
12
            if (txn != null) {
11
			if ( txn != null ) {
13
                try {
14
                    txn.rollback();
15
                } 
12
				try {
13
					txn.rollback();
14
				}
16
catch (Throwable ignore) {
15
				catch( Throwable ignore ) {
17
                }
18
            }
19
        } finally {
20
            
16
				}
17
			}
18
		}
19
		finally {
21
if (s != null && s.isOpen()) {
20
			if ( s != null && s.isOpen() ) {
22
                try {
23
                    s.close();
24
                } 
21
				try {
22
					s.close();
23
				}
25
catch (Throwable ignore) {
24
				catch( Throwable ignore ) {
26
                
25
				
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0