File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/id/MultipleHiLoPerTableGenerator.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/id/TableHiLoGenerator.java | |||
Method name: Serializable generate(SessionImplementor, Object)
|
Method name: Serializable generate(SessionImplementor, Object)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 4 | |||
1 | if (lo>maxLo) {↵ | |||
2 | int hival = ( (Integer) doWorkInNewTransaction(session) ).intValue();↵ | 1 | long hival = ( (Number) super.generate(session, obj) ).longValue();↵ | |
3 | lo = (hival == 0) ? 1 : 0;↵ | 2 | lo = (hival == 0) ? 1 : 0;↵ | |
4 | hi = hival * (maxLo+1);↵ | 3 | hi = hival * (maxLo+1);↵ | |
5 | log.debug("new hi value: " + hival);↵ | 4 |
| |
6 | } | |||
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 having the same super class |
Number of node comparisons | 11 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 7 | long hival = ((Number)super.generate(session, obj)).longValue(); | |||||||||||||
7 | int hival = ((Integer)doWorkInNewTransaction(session)).intValue(); | | |||||||||||||
8 | lo = (hival == 0) ? 1 : 0; |
| 8 | lo = (hival == 0) ? 1 : 0; | |||||||||||
| 9 | hi = hival * (maxLo + 1); | |||||||||||||
9 | hi = hival * (maxLo + 1); | | |||||||||||||
10 | log.debug("new hi value: " + hival); |
| 10 | log.debug("new hi value: " + hival); |
Row | Violation |
---|---|
1 | Type int of variable hival does not match with type long of variable hival |
2 | Type int of variable hival does not match with type long of variable hival |