log.warn("An item was expired by the cache while it was locked (increase your cache timeout): " + key); long ts = cache.nextTimestamp() + cache.getTimeout(); // create new lock that times out immediately Lock lock = new Lock( ts, nextLockId(), null ); lock.unlock(ts); cache.update(key, lock);
reportWarning( "Keyword '" + token.getText() + "' is being interpreted as an identifier due to: " + mte.getMessage() ); // Add the token to the AST. ASTPair currentAST = new ASTPair(); token.setType( HqlTokenTypes.WEIRD_IDENT ); astFactory.addASTChild( currentAST, astFactory.create( token ) ); consume(); AST identifierAST = currentAST.root; return identifierAST;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cache/ReadWriteCache.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/hql/ast/HqlParser.java
Method name: void handleLockExpiry(Object) Method name: AST handleIdentifierError(Token, RecognitionException)
Number of AST nodes: 5 Number of AST nodes: 7
1
log.warn("An item was expired by the cache while it was locked (increase your cache timeout): " + key);
2
		long ts = cache.nextTimestamp() + cache.getTimeout();
3
		// create new lock that times out immediately
4
		Lock lock = new Lock( ts, nextLockId(), null );
5
		lock.unlock(ts);
6
		cache.update(key, lock)
1
reportWarning( "Keyword  '"
2
							+ token.getText()
3
							+ "' is being interpreted as an identifier due to: " + mte.getMessage() );
4
					// Add the token to the AST.
5
					ASTPair currentAST = new ASTPair();
6
					token.setType( HqlTokenTypes.WEIRD_IDENT );
7
					astFactory.addASTChild( currentAST, astFactory.create( token ) );
8
					consume();
9
					AST identifierAST = currentAST.root;
7
;
10
					return identifierAST;
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.0
Clones locationClones are in different classes
Number of node comparisons35
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment5
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    log.warn("An item was expired by the cache while it was locked (increase your cache timeout): " + key);
    1
    log.warn("An item was expired by the cache while it was locked (increase your cache timeout): " + key);
    10
    consume();
    Differences
    Expression1Expression2Difference
    warnconsumeMETHOD_INVOCATION_NAME_MISMATCH
    log.warn("An item was expired by the cache while it was locked (increase your cache timeout): " + key)consume()ARGUMENT_NUMBER_MISMATCH
    logMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression log.warn("An item was expired by the cache while it was locked (increase your cache timeout): " + key) is a void method call, and thus it cannot be parameterized
    Expression consume() is a void method call, and thus it cannot be parameterized
    Expression log.warn("An item was expired by the cache while it was locked (increase your cache timeout): " + key) is a void method call, and thus it cannot be parameterized
    Expression consume() is a void method call, and thus it cannot be parameterized
    10
    consume();
    2
    long ts = cache.nextTimestamp() + cache.getTimeout();
                                                                                                                
    3
    Lock lock = new Lock(ts, nextLockId(), null);
                                                                                            
    4
    lock.unlock(ts);
                                          
    5
    cache.update(key, lock);
    5
    cache.update(key, lock);
    6
    reportWarning("Keyword '" + token.getText() + "' is being interpreted as an identifier due to: " + mte.getMessage());
    Differences
    Expression1Expression2Difference
    updatereportWarningMETHOD_INVOCATION_NAME_MISMATCH
    cache.update(key,lock)reportWarning("Keyword '" + token.getText() + "' is being interpreted as an identifier due to: "+ mte.getMessage())ARGUMENT_NUMBER_MISMATCH
    cacheMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression cache.update(key,lock) is a void method call, and thus it cannot be parameterized
    Expression reportWarning("Keyword '" + token.getText() + "' is being interpreted as an identifier due to: "+ mte.getMessage()) is a void method call, and thus it cannot be parameterized
    Expression cache.update(key,lock) is a void method call, and thus it cannot be parameterized
    Expression reportWarning("Keyword '" + token.getText() + "' is being interpreted as an identifier due to: "+ mte.getMessage()) is a void method call, and thus it cannot be parameterized
    6
    reportWarning("Keyword  '" + token.getText() + "' is being interpreted as an identifier due to: " + mte.getMessage());
                                                                            
    7
    ASTPair currentAST = new ASTPair();
                                                                                            
    8
    token.setType(HqlTokenTypes.WEIRD_IDENT);
                                                                                                                                  
    9
    astFactory.addASTChild(currentAST, astFactory.create(token));
                                                                                
    11
    AST identifierAST = currentAST.root;
                                                      
    12
    return identifierAST;
    Preondition Violations
    Unmatched return identifierAST;
    12
    return identifierAST;
    Precondition Violations (9)
    Row Violation
    1Expression log.warn("An item was expired by the cache while it was locked (increase your cache timeout): " + key) is a void method call, and thus it cannot be parameterized
    2Expression consume() is a void method call, and thus it cannot be parameterized
    3Expression log.warn("An item was expired by the cache while it was locked (increase your cache timeout): " + key) is a void method call, and thus it cannot be parameterized
    4Expression consume() is a void method call, and thus it cannot be parameterized
    5Expression cache.update(key,lock) is a void method call, and thus it cannot be parameterized
    6Expression reportWarning("Keyword '" + token.getText() + "' is being interpreted as an identifier due to: "+ mte.getMessage()) is a void method call, and thus it cannot be parameterized
    7Expression cache.update(key,lock) is a void method call, and thus it cannot be parameterized
    8Expression reportWarning("Keyword '" + token.getText() + "' is being interpreted as an identifier due to: "+ mte.getMessage()) is a void method call, and thus it cannot be parameterized
    9Unmatched return identifierAST;