try { return cache.get( new Fqn( regionFqn, key ), ITEM ); } catch (Exception e) { throw new CacheException(e); }
try { return cache.get(new Fqn(region, key), ITEM); } catch (Exception e) { throw new CacheException(e); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache/src/main/java/org/hibernate/cache/OptimisticTreeCache.java File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/util/CacheHelper.java
Method name: Object read(Object) Method name: Object get(Cache, Fqn, Object)
Number of AST nodes: 2 Number of AST nodes: 2
1
try {
1
try {
2
			return cache.get( new Fqn( regionFqn, key ), ITEM );
2
            return cache.get(new Fqn(region, key), ITEM);
3
		}
4
		catch (Exception e) {
3
        } catch (Exception e) {
5
			throw new CacheException(e);
4
            throw new CacheException(e);
6
		}
5
        }
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.1
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)0.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    try
    1
    try
    2
    return cache.get(new Fqn(regionFqn, key), ITEM);
    2
    return cache.get(new Fqn(regionFqn, key), ITEM);
    2
    return cache.get(new Fqn(region, key), ITEM);
    Differences
    Expression1Expression2Difference
    regionFqnregionVARIABLE_NAME_MISMATCH
    org.jboss.cache.TreeCacheorg.jboss.cache.CacheVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jboss.cache.TreeCache of variable cache does not match with type org.jboss.cache.Cache of variable cache
    • Make classes org.jboss.cache.TreeCache and org.jboss.cache.Cache extend a common superclass
    2
    return cache.get(new Fqn(region, key), ITEM);
    Precondition Violations (1)
    Row Violation
    1Type org.jboss.cache.TreeCache of variable cache does not match with type org.jboss.cache.Cache of variable cache