if (manager != null) { manager.shutdown(); manager = null; }
if ( value != null ) { Integer.parseInt( value ); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/cache-ehcache/src/main/java/org/hibernate/cache/EhCacheProvider.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/util/ExternalSessionFactoryConfig.java
Method name: void stop() Method name: void verifyInt(String)
Number of AST nodes: 3 Number of AST nodes: 2
1
if (manager != null) {
1
if ( value != null ) {
2
            manager.shutdown();
3
            manager = null;
4
        
2
			Integer.parseInt( value );
5
}
3
		}
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 comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.4
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (manager != null)
    1
    if (manager != null)
    1
    if (value != null)
    Differences
    Expression1Expression2Difference
    managervalueVARIABLE_NAME_MISMATCH
    net.sf.ehcache.CacheManagerjava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sf.ehcache.CacheManager of variable manager does not match with type java.lang.String of variable value
    • Make classes net.sf.ehcache.CacheManager and java.lang.String extend a common superclass
    1
    if (value != null)
                                                          
    2
    Integer.parseInt(value);
    2
    manager.shutdown();
                                                
    3
    manager = null;
                                    
    Precondition Violations (1)
    Row Violation
    1Type net.sf.ehcache.CacheManager of variable manager does not match with type java.lang.String of variable value