File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/hql/classic/QueryTranslatorImpl.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/loader/custom/sql/SQLQueryParser.java | |||
Method name: void addNamedParameter(String)
|
Method name: void addNamedParameter(String)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | if ( o instanceof Integer ) {↵ | 1 | if ( o instanceof Integer ) {↵ | |
2 | ArrayList list = new ArrayList( 4 );↵ | 2 | ArrayList list = new ArrayList( 4 );↵ | |
3 | list.add( o );↵ | 3 | list.add( o );↵ | |
4 | list.add( loc );↵ | 4 | list.add( loc );↵ | |
5 | namedParameters.put( name, list );↵ | 5 | namedParameterBindPoints.put( name, list );↵ | |
6 | }↵ | 6 | }↵ | |
7 | else {↵ | 7 | else {↵ | |
8 | ( ( ArrayList ) o ).add( loc );↵ | 8 | ( ( List ) o ).add( loc );↵ | |
9 | } | 9 | } | |
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 | 36 |
Number of mapped statements | 6 |
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) | 2.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7 | else if (o instanceof Integer) | 5 | else if (o instanceof Integer) | ||||||||||||||
8 | ArrayList list = new ArrayList(4); | 6 | ArrayList list = new ArrayList(4); | ||||||||||||||
9 | list.add(o); | 7 | list.add(o); | ||||||||||||||
10 | list.add(loc); | 8 | list.add(loc); | ||||||||||||||
11 | namedParameters.put(name, list); |
| 9 | namedParameterBindPoints.put(name, list); | |||||||||||||
else | else | ||||||||||||||||
12 | ((ArrayList)o).add(loc); |
| 10 | ((List)o).add(loc); |
Row | Violation |
---|---|
1 | Expression (ArrayList)o cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression (List)o cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Type java.util.ArrayList of variable (ArrayList)o does not match with type java.util.List of variable (List)o |