try { long txTimestamp = System.currentTimeMillis(); BatchModeTransactionManager.getInstance().begin(); assertEquals("Correct initial value", VALUE1, localAccessStrategy.get(KEY, txTimestamp)); localAccessStrategy.update(KEY, VALUE2, new Integer(2), new Integer(1)); readLatch.countDown(); commitLatch.await(); BatchModeTransactionManager.getInstance().commit(); } catch (Exception e) { log.error("node1 caught exception", e); node1Exception = e; rollback(); } catch (AssertionFailedError e) { node1Failure = e; rollback(); } finally { completionLatch.countDown(); }
try { long txTimestamp = System.currentTimeMillis(); BatchModeTransactionManager.getInstance().begin(); assertEquals("Correct initial value", VALUE1, localAccessStrategy.get(KEY, txTimestamp)); localAccessStrategy.update(KEY, VALUE2, new Integer(2), new Integer(1)); pferLatch.countDown(); commitLatch.await(); BatchModeTransactionManager.getInstance().commit(); } catch (Exception e) { log.error("node1 caught exception", e); node1Exception = e; rollback(); } catch (AssertionFailedError e) { node1Failure = e; rollback(); } finally { completionLatch.countDown(); }
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/entity/AbstractEntityRegionAccessStrategyTestCase.java File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/entity/AbstractTransactionalAccessTestCase.java
Method name: void run() Method name: void run()
Number of AST nodes: 8 Number of AST nodes: 8
1
try {       
1
try {       
2
                    long txTimestamp = System.currentTimeMillis();
2
                    long txTimestamp = System.currentTimeMillis();
3
                    BatchModeTransactionManager.getInstance().begin();
3
                    BatchModeTransactionManager.getInstance().begin();
4
                    
4
                    
5
                    assertEquals("Correct initial value", VALUE1, localAccessStrategy.get(KEY, txTimestamp));
5
                    assertEquals("Correct initial value", VALUE1, localAccessStrategy.get(KEY, txTimestamp));
6
                    
6
                    
7
                    localAccessStrategy.update(KEY, VALUE2, new Integer(2), new Integer(1));
7
                    localAccessStrategy.update(KEY, VALUE2, new Integer(2), new Integer(1));
8
                    
8
                    
9
                    readLatch.countDown();
9
                    pferLatch.countDown();
10
                    commitLatch.await();
10
                    commitLatch.await();
11
                    
11
                    
12
                    BatchModeTransactionManager.getInstance().commit();
12
                    BatchModeTransactionManager.getInstance().commit();
13
                }
13
                }
14
                catch (Exception e) {
14
                catch (Exception e) {
15
                    log.error("node1 caught exception", e);
15
                    log.error("node1 caught exception", e);
16
                    node1Exception = e;
16
                    node1Exception = e;
17
                    rollback();
17
                    rollback();
18
                }
18
                }
19
                catch (AssertionFailedError e) {
19
                catch (AssertionFailedError e) {
20
                    node1Failure = e;
20
                    node1Failure = e;
21
                    rollback();
21
                    rollback();
22
                }
22
                }
23
                finally {
23
                finally {
24
                    completionLatch.countDown();
24
                    completionLatch.countDown();
25
                }
25
                }
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)1.5
Clones locationClones are in different classes having the same super class
Number of node comparisons64
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)4.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    try
    1
    try
    1
    try
    Differences
    Expression1Expression2Difference
    readLatchpferLatchVARIABLE_NAME_MISMATCH
    1
    try
    2
    long txTimestamp = System.currentTimeMillis();
    2
    long txTimestamp = System.currentTimeMillis();
    3
    BatchModeTransactionManager.getInstance().begin();
    3
    BatchModeTransactionManager.getInstance().begin();
    4
    assertEquals("Correct initial value", VALUE1, localAccessStrategy.get(KEY, txTimestamp));
    4
    assertEquals("Correct initial value", VALUE1, localAccessStrategy.get(KEY, txTimestamp));
    5
    localAccessStrategy.update(KEY, VALUE2, new Integer(2), new Integer(1));
    5
    localAccessStrategy.update(KEY, VALUE2, new Integer(2), new Integer(1));
    6
    readLatch.countDown();
    6
    readLatch.countDown();
    6
    pferLatch.countDown();
    Differences
    Expression1Expression2Difference
    readLatchpferLatchVARIABLE_NAME_MISMATCH
    6
    pferLatch.countDown();
    7
    commitLatch.await();
    7
    commitLatch.await();
    8
    BatchModeTransactionManager.getInstance().commit();
    8
    BatchModeTransactionManager.getInstance().commit();
    Precondition Violations (0)
    Row Violation