super.tearDown(); if (localCollectionRegion != null) localCollectionRegion.destroy(); if (remoteCollectionRegion != null) remoteCollectionRegion.destroy(); try { localCache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true); localCache.removeNode(Fqn.ROOT); } catch (Exception e) { log.error("Problem purging local cache" ,e); } try { remoteCache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true); remoteCache.removeNode(Fqn.ROOT); } catch (Exception e) { log.error("Problem purging remote cache" ,e); } node1Exception = null; node2Exception = null; node1Failure = null; node2Failure = null;
super.tearDown(); if (localEntityRegion != null) localEntityRegion.destroy(); if (remoteEntityRegion != null) remoteEntityRegion.destroy(); try { localCache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true); localCache.removeNode(Fqn.ROOT); } catch (Exception e) { log.error("Problem purging local cache" ,e); } try { remoteCache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true); remoteCache.removeNode(Fqn.ROOT); } catch (Exception e) { log.error("Problem purging remote cache" ,e); } node1Exception = null; node2Exception = null; node1Failure = null; node2Failure = null;
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/collection/AbstractCollectionRegionAccessStrategyTestCase.java File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/entity/AbstractEntityRegionAccessStrategyTestCase.java
Method name: void tearDown() Method name: void tearDown()
Number of AST nodes: 15 Number of AST nodes: 15
1
super.tearDown();
1
super.tearDown();
2
        
2
        
3
        if (localCollectionRegion != null)
3
        if (localEntityRegion != null)
4
            localCollectionRegion.destroy();
4
            localEntityRegion.destroy();
5
        if (remoteCollectionRegion != null)
5
        if (remoteEntityRegion != null)
6
            remoteCollectionRegion.destroy();
6
            remoteEntityRegion.destroy();
7
        
7
        
8
        try {
8
        try {
9
            localCache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
9
            localCache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
10
            localCache.removeNode(Fqn.ROOT);
10
            localCache.removeNode(Fqn.ROOT);
11
        }
11
        }
12
        catch (Exception e) {
12
        catch (Exception e) {
13
            log.error("Problem purging local cache" ,e);
13
            log.error("Problem purging local cache" ,e);
14
        }
14
        }
15
        
15
        
16
        try {
16
        try {
17
            remoteCache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
17
            remoteCache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
18
            remoteCache.removeNode(Fqn.ROOT);
18
            remoteCache.removeNode(Fqn.ROOT);
19
        }
19
        }
20
        catch (Exception e) {
20
        catch (Exception e) {
21
            log.error("Problem purging remote cache" ,e);
21
            log.error("Problem purging remote cache" ,e);
22
        }
22
        }
23
        
23
        
24
        node1Exception = null;
24
        node1Exception = null;
25
        node2Exception = null;
25
        node2Exception = null;
26
        
26
        
27
        node1Failure = null;
27
        node1Failure = null;
28
        node2Failure  = null;
28
        node2Failure  = null;
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)1.0
Clones locationClones are in different classes having the same super class
Number of node comparisons60
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements15
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)11.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    super.tearDown();
    1
    super.tearDown();
    1
    super.tearDown();
    Preondition Violations
    Super method call super.tearDown(); cannot be extracted from method
    Super method call super.tearDown(); cannot be extracted from method
    1
    super.tearDown();
    2
    if (localCollectionRegion != null)
    2
    if (localCollectionRegion != null)
    2
    if (localEntityRegion != null)
    Differences
    Expression1Expression2Difference
    localCollectionRegionlocalEntityRegionVARIABLE_NAME_MISMATCH
    org.hibernate.cache.CollectionRegionorg.hibernate.cache.EntityRegionSUBCLASS_TYPE_MISMATCH
    2
    if (localEntityRegion != null)
    3
    localCollectionRegion.destroy();
    3
    localCollectionRegion.destroy();
    3
    localEntityRegion.destroy();
    Differences
    Expression1Expression2Difference
    localCollectionRegionlocalEntityRegionVARIABLE_NAME_MISMATCH
    org.hibernate.cache.CollectionRegionorg.hibernate.cache.EntityRegionSUBCLASS_TYPE_MISMATCH
    3
    localEntityRegion.destroy();
    4
    if (remoteCollectionRegion != null)
    4
    if (remoteCollectionRegion != null)
    4
    if (remoteEntityRegion != null)
    Differences
    Expression1Expression2Difference
    remoteCollectionRegionremoteEntityRegionVARIABLE_NAME_MISMATCH
    org.hibernate.cache.CollectionRegionorg.hibernate.cache.EntityRegionSUBCLASS_TYPE_MISMATCH
    4
    if (remoteEntityRegion != null)
    5
    remoteCollectionRegion.destroy();
    5
    remoteCollectionRegion.destroy();
    5
    remoteEntityRegion.destroy();
    Differences
    Expression1Expression2Difference
    remoteCollectionRegionremoteEntityRegionVARIABLE_NAME_MISMATCH
    org.hibernate.cache.CollectionRegionorg.hibernate.cache.EntityRegionSUBCLASS_TYPE_MISMATCH
    5
    remoteEntityRegion.destroy();
    6
    try
    6
    try
    7
    localCache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
    7
    localCache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
    8
    localCache.removeNode(Fqn.ROOT);
    8
    localCache.removeNode(Fqn.ROOT);
    9
    try
    9
    try
    10
    remoteCache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
    10
    remoteCache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
    11
    remoteCache.removeNode(Fqn.ROOT);
    11
    remoteCache.removeNode(Fqn.ROOT);
    12
    node1Exception = null;
    12
    node1Exception = null;
    13
    node2Exception = null;
    13
    node2Exception = null;
    14
    node1Failure = null;
    14
    node1Failure = null;
    15
    node2Failure = null;
    15
    node2Failure = null;
    Precondition Violations (2)
    Row Violation
    1Super method call super.tearDown(); cannot be extracted from method
    2Super method call super.tearDown(); cannot be extracted from method