super( returnClass, incrementSize );
if ( incrementSize < 1 ) {
throw new HibernateException( "increment size cannot be less than 1" );
}
if ( log.isTraceEnabled() ) {
log.trace( "creating hilo optimizer with [incrementSize=" + incrementSize + "; returnClass=" + returnClass.getName() + "]" );
}
super( returnClass, incrementSize );
if ( incrementSize < 1 ) {
throw new HibernateException( "increment size cannot be less than 1" );
}
if ( log.isTraceEnabled() ) {
log.trace( "creating pooled optimizer with [incrementSize=" + incrementSize + "; returnClass=" + returnClass.getName() + "]" );
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/id/enhanced/OptimizerFactory.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/id/enhanced/OptimizerFactory.java
|
Method name: void HiLoOptimizer(Class, int)
|
|
Method name: void PooledOptimizer(Class, int)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | super( returnClass, incrementSize );↵ | | 1 | super( returnClass, incrementSize );↵
|
2 | if ( incrementSize < 1 ) {↵ | | 2 | if ( incrementSize < 1 ) {↵
|
3 | throw new HibernateException( "increment size cannot be less than 1" );↵ | | 3 | throw new HibernateException( "increment size cannot be less than 1" );↵
|
4 | }↵ | | 4 | }↵
|
5 | if ( log.isTraceEnabled() ) {↵ | | 5 | if ( log.isTraceEnabled() ) {↵
|
6 | log.trace( "creating hilo optimizer with [incrementSize=" + incrementSize + "; returnClass=" + returnClass.getName() + "]" );↵ | | 6 | log.trace( "creating pooled optimizer with [incrementSize=" + incrementSize + "; returnClass=" + returnClass.getName() + "]" );↵
|
7 | } | | 7 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in the same java file |
Number of node comparisons | 14 |
-
{Refactorable}
Mapping Summary
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.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | super(returnClass, incrementSize); | | 1 | super(returnClass, incrementSize); |
2 | if (incrementSize < 1) | | 2 | if (incrementSize < 1) |
3 | throw new HibernateException("increment size cannot be less than 1"); | | 3 | throw new HibernateException("increment size cannot be less than 1"); |
4 | if (log.isTraceEnabled()) | | 4 | if (log.isTraceEnabled()) |
5 | log.trace("creating hilo optimizer with [incrementSize=" + incrementSize + "; returnClass=" + returnClass.getName() + "]"); | | 5 | log.trace("creating pooled optimizer with [incrementSize=" + incrementSize + "; returnClass=" + returnClass.getName() + "]"); |
Precondition Violations (0)
Row |
Violation |