Long ts = new Long( region.nextTimestamp() + region.getTimeout() ); for ( int i=0; i<spaces.length; i++ ) { if ( log.isDebugEnabled() ) { log.debug( "Pre-invalidating space [" + spaces[i] + "]" ); } //put() has nowait semantics, is this really appropriate? //note that it needs to be async replication, never local or sync region.put( spaces[i], ts ); }
Long ts = new Long( region.nextTimestamp() ); //TODO: if lock.getTimestamp().equals(ts) for ( int i=0; i<spaces.length; i++ ) { if ( log.isDebugEnabled() ) { log.debug( "Invalidating space [" + spaces[i] + "], timestamp: " + ts); } //put() has nowait semantics, is this really appropriate? //note that it needs to be async replication, never local or sync region.put( spaces[i], ts ); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cache/UpdateTimestampsCache.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cache/UpdateTimestampsCache.java
Method name: void preinvalidate(Serializable[]) Method name: void invalidate(Serializable[])
Number of AST nodes: 5 Number of AST nodes: 5
1
Long ts = new Long( region.nextTimestamp() + region.getTimeout() );
1
Long ts = new Long( region.nextTimestamp() );
2
		//TODO: if lock.getTimestamp().equals(ts)
2
		for ( int i=0; i<spaces.length; i++ ) {
3
		for ( int i=0; i<spaces.length; i++ ) {
3
			if ( log.isDebugEnabled() ) {
4
			if ( log.isDebugEnabled() ) {
4
				log.debug( "Pre-invalidating space [" + spaces[i] + "]" );
5
				log.debug( "Invalidating space [" + spaces[i] + "], timestamp: " + ts);
5
			}
6
			}
6
			//put() has nowait semantics, is this really appropriate?
7
			//put() has nowait semantics, is this really appropriate?
7
			//note that it needs to be async replication, never local or sync
8
			//note that it needs to be async replication, never local or sync
8
			region.put( spaces[i], ts );
9
			region.put( spaces[i], ts );
9
		}
10
		}
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 declared in the same class
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Long ts = new Long(region.nextTimestamp() + region.getTimeout());
    1
    Long ts = new Long(region.nextTimestamp() + region.getTimeout());
    1
    Long ts = new Long(region.nextTimestamp());
    Differences
    Expression1Expression2Difference
    region.nextTimestamp() + region.getTimeout()region.nextTimestamp()TYPE_COMPATIBLE_REPLACEMENT
    1
    Long ts = new Long(region.nextTimestamp());
    2
    for (int i = 0; i < spaces.length; i++)
    2
    for (int i = 0; i < spaces.length; i++)
    3
    if (log.isDebugEnabled())
    3
    if (log.isDebugEnabled())
    4
    log.debug("Pre-invalidating space [" + spaces[i] + "]");
    4
    log.debug("Pre-invalidating space [" + spaces[i] + "]");
    4
    log.debug("Invalidating space [" + spaces[i] + "], timestamp: " + ts);
    Differences
    Expression1Expression2Difference
    "Pre-invalidating space [""Invalidating space ["LITERAL_VALUE_MISMATCH
    "Pre-invalidating space [" + spaces[i] + "]""Invalidating space [" + spaces[i] + "], timestamp: "+ tsINFIX_EXTENDED_OPERAND_NUMBER_MISMATCH
    Preondition Violations
    Expression "Pre-invalidating space [" + spaces[i] + "]" cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression "Invalidating space [" + spaces[i] + "], timestamp: "+ ts cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    log.debug("Invalidating space [" + spaces[i] + "], timestamp: " + ts);
    5
    region.put(spaces[i], ts);
    5
    region.put(spaces[i], ts);
    Precondition Violations (2)
    Row Violation
    1Expression "Pre-invalidating space [" + spaces[i] + "]" cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression "Invalidating space [" + spaces[i] + "], timestamp: "+ ts cannot be parameterized, because it has dependencies to/from statements that will be extracted