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; | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are in different classes |
Number of node comparisons | 35 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 5 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | log.warn("An item was expired by the cache while it was locked (increase your cache timeout): " + key); |
| 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); |
| 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; |
Row | Violation |
---|---|
1 | 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 |
2 | Expression consume() is a void method call, and thus it cannot be parameterized |
3 | 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 |
4 | Expression consume() is a void method call, and thus it cannot be parameterized |
5 | Expression cache.update(key,lock) is a void method call, and thus it cannot be parameterized |
6 | 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 |
7 | Expression cache.update(key,lock) is a void method call, and thus it cannot be parameterized |
8 | 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 |
9 | Unmatched return identifierAST; |