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: 8 | Number of AST nodes: 8 | |||
1 | if ( o == null ) {↵ | 1 | if ( o == null ) {↵ | |
2 | namedParameters.put( name, loc );↵ | 2 | namedParameterBindPoints.put( name, loc );↵ | |
3 | }↵ | 3 | }↵ | |
4 | else if ( o instanceof Integer ) {↵ | 4 | else if ( o instanceof Integer ) {↵ | |
5 | ArrayList list = new ArrayList( 4 );↵ | 5 | ArrayList list = new ArrayList( 4 );↵ | |
6 | list.add( o );↵ | 6 | list.add( o );↵ | |
7 | list.add( loc );↵ | 7 | list.add( loc );↵ | |
8 | namedParameters.put( name, list );↵ | 8 | namedParameterBindPoints.put( name, list );↵ | |
9 | }↵ | 9 | }↵ | |
10 | else {↵ | 10 | else {↵ | |
11 | ( ( ArrayList ) o ).add( loc );↵ | 11 | ( ( List ) o ).add( loc );↵ | |
12 | } | 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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 53 |
Number of mapped statements | 8 |
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) | 5.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5 | if (o == null) | 3 | if (o == null) | |||||||||||||
6 | namedParameters.put(name, loc); |
| 4 | namedParameterBindPoints.put(name, loc); | ||||||||||||
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 | The refactoring of the clones is infeasible, because classes org.hibernate.hql.classic.QueryTranslatorImpl and org.hibernate.loader.custom.sql.SQLQueryParser.ParameterSubstitutionRecognizer do not have a common superclass |