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)0.8
Clones locationClones are in different classes having the same super class
Number of node comparisons80
  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)4.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    super.tearDown();
    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.EntityRegionVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.cache.CollectionRegion of variable localCollectionRegion does not match with type org.hibernate.cache.EntityRegion of variable localEntityRegion
    • Make classes org.hibernate.cache.CollectionRegion and org.hibernate.cache.EntityRegion extend a common superclass
    2
    if (localEntityRegion != null)
    3
    localCollectionRegion.destroy();
    3
    localCollectionRegion.destroy();
    3
    localEntityRegion.destroy();
    Differences
    Expression1Expression2Difference
    localCollectionRegionlocalEntityRegionVARIABLE_NAME_MISMATCH
    org.hibernate.cache.CollectionRegionorg.hibernate.cache.EntityRegionVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.cache.CollectionRegion of variable localCollectionRegion does not match with type org.hibernate.cache.EntityRegion of variable localEntityRegion
    • Make classes org.hibernate.cache.CollectionRegion and org.hibernate.cache.EntityRegion extend a common superclass
    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.EntityRegionVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.cache.CollectionRegion of variable remoteCollectionRegion does not match with type org.hibernate.cache.EntityRegion of variable remoteEntityRegion
    • Make classes org.hibernate.cache.CollectionRegion and org.hibernate.cache.EntityRegion extend a common superclass
    4
    if (remoteEntityRegion != null)
    5
    remoteCollectionRegion.destroy();
    5
    remoteCollectionRegion.destroy();
    5
    remoteEntityRegion.destroy();
    Differences
    Expression1Expression2Difference
    remoteCollectionRegionremoteEntityRegionVARIABLE_NAME_MISMATCH
    org.hibernate.cache.CollectionRegionorg.hibernate.cache.EntityRegionVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.cache.CollectionRegion of variable remoteCollectionRegion does not match with type org.hibernate.cache.EntityRegion of variable remoteEntityRegion
    • Make classes org.hibernate.cache.CollectionRegion and org.hibernate.cache.EntityRegion extend a common superclass
    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 (4)
    Row Violation
    1Type org.hibernate.cache.CollectionRegion of variable localCollectionRegion does not match with type org.hibernate.cache.EntityRegion of variable localEntityRegion
    2Type org.hibernate.cache.CollectionRegion of variable localCollectionRegion does not match with type org.hibernate.cache.EntityRegion of variable localEntityRegion
    3Type org.hibernate.cache.CollectionRegion of variable remoteCollectionRegion does not match with type org.hibernate.cache.EntityRegion of variable remoteEntityRegion
    4Type org.hibernate.cache.CollectionRegion of variable remoteCollectionRegion does not match with type org.hibernate.cache.EntityRegion of variable remoteEntityRegion