File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/transform/AliasToEntityMapResultTransformer.java | File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/sql/hand/query/NativeSQLQueriesTest.java | |||
Method name: Object transformTuple(Object[], String[])
|
Method name: Object transformTuple(Object[], String[])
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | Map result = new HashMap(tuple.length);↵ | 1 | Map result = new HashMap( tuple.length );↵ | |
2 | for ( int i=0; i<tuple.length; i++ ) {↵ | 2 | for ( int i = 0; i < tuple.length; i++ ) {↵ | |
3 | String alias = aliases[i];↵ | 3 | String alias = aliases[i];↵ | |
4 | if ( alias!=null ) {↵ | 4 | if ( alias != null ) {↵ | |
5 | result.put( alias, tuple[i] );↵ | 5 | result.put( alias.toUpperCase(), tuple[i] );↵ | |
6 | }↵ | 6 | }↵ | |
7 | }↵ | 7 | }↵ | |
8 | return result; | 8 | return result; | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 10 |
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) | 1.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Map result = new HashMap(tuple.length); | 1 | Map result = new HashMap(tuple.length); | |||||||||||||
2 | for (int i = 0; i < tuple.length; i++) | 2 | for (int i = 0; i < tuple.length; i++) | |||||||||||||
3 | String alias = aliases[i]; | 3 | String alias = aliases[i]; | |||||||||||||
4 | if (alias != null) | 4 | if (alias != null) | |||||||||||||
5 | result.put(alias, tuple[i]); |
| 5 | result.put(alias.toUpperCase(), tuple[i]); | ||||||||||||
6 | return result; | 6 | return result; |
Row | Violation |
---|---|
1 | Expression alias cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression alias.toUpperCase() cannot be parameterized, because it has dependencies to/from statements that will be extracted |