try { // TODO : what amount of significant digits need to be supported here? // - from the DecimalFormat docs: // [significant digits] = [minimum integer digits] + [maximum fraction digits] DecimalFormat jdkFormatter = new DecimalFormat( FORMAT_STRING ); jdkFormatter.setMinimumIntegerDigits( 1 ); jdkFormatter.setMaximumFractionDigits( Integer.MAX_VALUE ); return jdkFormatter.format( number ); } catch( Throwable t ) { throw new HibernateException( "Unable to format decimal literal in approximate format [" + number.toString() + "]", t ); }
try { TransactionManagerLookup lookup = ( TransactionManagerLookup ) ReflectHelper.classForName( tmLookupClass ).newInstance(); log.info( "instantiated TransactionManagerLookup" ); return lookup; } catch ( Exception e ) { log.error( "Could not instantiate TransactionManagerLookup", e ); throw new HibernateException( "Could not instantiate TransactionManagerLookup '" + tmLookupClass + "'" ); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/hql/ast/util/LiteralProcessor.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/transaction/TransactionManagerLookupFactory.java
Method name: String format(BigDecimal) Method name: TransactionManagerLookup getTransactionManagerLookup(Properties)
Number of AST nodes: 5 Number of AST nodes: 4
1
try {
1
try {
2
				// TODO : what amount of significant digits need to be supported here?
2
				
3
				//      - from the DecimalFormat docs:
4
				//          [significant digits] = [minimum integer digits] + [maximum fraction digits]
5
				DecimalFormat jdkFormatter = new DecimalFormat( FORMAT_STRING );
6
				jdkFormatter.setMinimumIntegerDigits( 1 );
7
				jdkFormatter.setMaximumFractionDigits( Integer.MAX_VALUE );
8
				return jdkFormatter.format( number )
3
TransactionManagerLookup lookup = ( TransactionManagerLookup )
4
						ReflectHelper.classForName( tmLookupClass ).newInstance();
5
				log.info( "instantiated TransactionManagerLookup" );
9
;
6
				return lookup;
10
			}
7
			}
11
			catch( Throwable t ) {
8
			catch ( 
12
				throw new HibernateException( "Unable to format decimal literal in approximate format [" + number.toString() + "]", t
9
Exception e ) {
10
				log.error( "Could not instantiate TransactionManagerLookup", e );
13
 );
11
				throw new HibernateException( "Could not instantiate TransactionManagerLookup '" + tmLookupClass + "'" );
14
			}
12
			}
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in different classes
Number of node comparisons1