File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache/src/main/java/org/hibernate/cache/OptimisticTreeCache.java | File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/util/DataVersionAdapter.java | |||
Method name: boolean newerThan(DataVersion)
|
Method name: boolean newerThan(DataVersion)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | if ( other.previousVersion == null ) {↵ | 1 | if (other.previousVersion == null) {↵ | |
2 | ↵ | |||
3 | log.warn( "Unexpected optimistic lock check on inserting data" );↵ | 2 | log.warn("Unexpected optimistic lock check on inserting data");↵ | |
4 | ↵ | |||
5 | // work around the "feature" where tree cache is validating the↵ | 3 | // work around the "feature" where tree cache is validating the↵ | |
6 | ↵ | |||
7 | // inserted node during the next transaction. no idea...↵ | 4 | // inserted node during the next transaction. no idea...↵ | |
8 | ↵ | |||
9 | if ( this == dataVersion ) {↵ | 5 | if (this == dataVersion) {↵ | |
10 | ↵ | |||
11 | log.trace( "skipping lock checks due to same DV instance" );↵ | 6 | log.trace("skipping lock checks due to same DV instance");↵ | |
12 | return false;↵ | |||
13 | }↵ | |||
14 | ↵ | |||
7 | return false;↵ | |||
8 | }↵ | |||
15 | } | 9 | } | |
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 13 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9 | if (other.previousVersion == null) |
| 13 | if (other.previousVersion == null) | |||||||||||
10 | log.warn("Unexpected optimistic lock check on inserting data"); | 14 | log.warn("Unexpected optimistic lock check on inserting data"); | ||||||||||||
11 | if (this == dataVersion) | 15 | if (this == dataVersion) | ||||||||||||
12 | log.trace("skipping lock checks due to same DV instance"); | 16 | log.trace("skipping lock checks due to same DV instance"); | ||||||||||||
13 | return false; |
| 17 | return false; |
Row | Violation |
---|---|
1 | Type org.hibernate.cache.OptimisticTreeCache.DataVersionAdapter of variable other does not match with type org.hibernate.cache.jbc2.util.DataVersionAdapter of variable other |
2 | Conditional return false; |
3 | Conditional return false; |