try { cacheRegion.destroy(); } catch ( Exception e ) { log.warn( "could not destroy query cache: " + cacheRegion.getName(), e ); }
try { cache.destroy(); } catch (Exception e) { log.warn("could not destroy cache", e); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cache/StandardQueryCache.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cache/ReadOnlyCache.java
Method name: void destroy() Method name: void destroy()
Number of AST nodes: 2 Number of AST nodes: 2
1
try {
1
try {
2
			cacheRegion.destroy();
2
			cache.destroy();
3
		}
3
		}
4
		catch ( Exception e ) {
4
		catch (Exception e) {
5
			log.warn( "could not destroy query cache: " + cacheRegion.getName(), e );
5
			log.warn("could not destroy cache", e);
6
		}
6
		}
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.2
Clones locationClones are in different classes
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)70.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    try
    1
    try
    1
    try
    Differences
    Expression1Expression2Difference
    "could not destroy query cache: " + cacheRegion.getName()"could not destroy cache"TYPE_COMPATIBLE_REPLACEMENT
    1
    try
    2
    cacheRegion.destroy();
    2
    cacheRegion.destroy();
    2
    cache.destroy();
    Differences
    Expression1Expression2Difference
    cacheRegioncacheVARIABLE_NAME_MISMATCH
    org.hibernate.cache.QueryResultsRegionorg.hibernate.cache.CacheVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.cache.QueryResultsRegion of variable cacheRegion does not match with type org.hibernate.cache.Cache of variable cache
    • Make classes org.hibernate.cache.QueryResultsRegion and org.hibernate.cache.Cache extend a common superclass
    2
    cache.destroy();
    Precondition Violations (1)
    Row Violation
    1Type org.hibernate.cache.QueryResultsRegion of variable cacheRegion does not match with type org.hibernate.cache.Cache of variable cache