if (lo>maxLo) { int hival = ( (Integer) doWorkInNewTransaction(session) ).intValue(); lo = (hival == 0) ? 1 : 0; hi = hival * (maxLo+1); log.debug("new hi value: " + hival); }
long hival = ( (Number) super.generate(session, obj) ).longValue(); lo = (hival == 0) ? 1 : 0; hi = hival * (maxLo+1); log.debug("new hi value: " + hival);
Clone fragments detected by clone detection tool
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
			log.debug("new hi value: " + hival);
6
		}
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 having the same super class
Number of node comparisons11
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    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;
    8
    lo = (hival == 0) ? 1 : 0;
    Differences
    Expression1Expression2Difference
    intlongVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable hival does not match with type long of variable hival
    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);
    10
    log.debug("new hi value: " + hival);
    Differences
    Expression1Expression2Difference
    intlongVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable hival does not match with type long of variable hival
    10
    log.debug("new hi value: " + hival);
    Precondition Violations (2)
    Row Violation
    1Type int of variable hival does not match with type long of variable hival
    2Type int of variable hival does not match with type long of variable hival