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 |
| |||
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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 16 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 5 |
Time elapsed for statement mapping (ms) | 0.9 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | MethodNode methodNode = (MethodNode)m; | ||||||||||||||||
1 | List actions = (List)actionBatches.get(batchNumber); | | ||||||||||||||||
| 2 | SQLFunction template = methodNode.getSQLFunction(); | ||||||||||||||||
2 | if (actions == null) |
| 3 | if (template == null) | ||||||||||||||
3 | actions = new LinkedList(); |
| | |||||||||||||||
| 4 | super.beginFunctionTemplate(m, i); | ||||||||||||||||
4 | actionBatches.put(batchNumber, actions); | | ||||||||||||||||
| else | |||||||||||||||||
| 5 | outputStack.addFirst(writer); | ||||||||||||||||
| 6 | writer = new FunctionArguments(); | ||||||||||||||||
5 | actions.add(action); | |
Row | Violation |
---|---|
1 | Type java.util.List of variable actions does not match with type org.hibernate.dialect.function.SQLFunction of variable template |
2 | Unmatched statement actions=new LinkedList(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |