List actions = ( List ) actionBatches.get( batchNumber ); if ( actions == null ) { actions = new LinkedList(); actionBatches.put( batchNumber, actions ); } actions.add( action );
MethodNode methodNode = ( MethodNode ) m; SQLFunction template = methodNode.getSQLFunction(); if ( template == null ) { // if template is null we just write the function out as it appears in the hql statement super.beginFunctionTemplate( m, i ); } else { // this function has a template -> redirect output and catch the arguments outputStack.addFirst( writer ); writer = new FunctionArguments(); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/ActionQueue.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/hql/ast/SqlGenerator.java
Method name: void addToBatch(Integer, EntityInsertAction) Method name: void beginFunctionTemplate(AST, AST)
Number of AST nodes: 5 Number of AST nodes: 6
1
List actions = ( List ) actionBatches.get( batchNumber 
1
MethodNode methodNode = ( MethodNode ) m;
2
);
2
		SQLFunction template = methodNode.getSQLFunction();
3
			if ( actions == null ) {
3
		if ( template == null ) {
4
				actions = new LinkedList();
4
			
5
				actionBatches.put( batchNumber, actions );
6
			}
7
			actions.add( action );
5
// if template is null we just write the function out as it appears in the hql statement
6
			super.beginFunctionTemplate( m, i );
7
		}
8
		else {
9
			// this function has a template -> redirect output and catch the arguments
10
			outputStack.addFirst( writer );
11
			writer = new FunctionArguments();
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 comparisons5