if ( minimalPut && cache.read( key ) != null ) { if ( log.isDebugEnabled() ) { log.debug( "item already cached: " + key ); } return false; }
if ( log.isTraceEnabled() ) { log.trace( "using initial version: " + initialVersion ); } return false;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cache/TransactionalCache.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/Versioning.java
Method name: boolean put(Object, Object, long, Object, Comparator, boolean) Method name: boolean seedVersion(Object[], int, VersionType, SessionImplementor)
Number of AST nodes: 4 Number of AST nodes: 3
1
if ( minimalPut && cache.read( key ) != null ) {
2
			if ( log.isDebugEnabled() ) {
1
if ( log.isTraceEnabled() ) {
3
				log.debug( "item already cached: " + key );
2
				log.trace( "using initial version: " + initialVersion );
4
			}
3
			}
5
			return false;
4
			return false;
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.1
Clones locationClones are in different classes
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    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.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    if (log.isDebugEnabled())
    2
    if (log.isDebugEnabled())
    5
    if (log.isTraceEnabled())
    Differences
    Expression1Expression2Difference
    isDebugEnabledisTraceEnabledMETHOD_INVOCATION_NAME_MISMATCH
    5
    if (log.isTraceEnabled())
    3
    log.debug("item already cached: " + key);
    3
    log.debug("item already cached: " + key);
    6
    log.trace("using initial version: " + initialVersion);
    Differences
    Expression1Expression2Difference
    debugtraceMETHOD_INVOCATION_NAME_MISMATCH
    "item already cached: ""using initial version: "LITERAL_VALUE_MISMATCH
    keyinitialVersionVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression log.debug("item already cached: " + key) is a void method call, and thus it cannot be parameterized
    Expression log.trace("using initial version: " + initialVersion) is a void method call, and thus it cannot be parameterized
    6
    log.trace("using initial version: " + initialVersion);
    4
    return false;
    7
    return false;
    Precondition Violations (2)
    Row Violation
    1Expression log.debug("item already cached: " + key) is a void method call, and thus it cannot be parameterized
    2Expression log.trace("using initial version: " + initialVersion) is a void method call, and thus it cannot be parameterized