File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/transform/AliasToBeanResultTransformer.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/transform/AliasToEntityMapResultTransformer.java | |||
Method name: Object transformTuple(Object[], String[])
|
Method name: Object transformTuple(Object[], String[])
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | for ( int i = 0; i < aliases.length; i++ ) {↵ | 1 | for ( int i=0; i<tuple.length; i++ ) {↵ | |
2 | String alias = aliases[i];↵ | 2 | String alias = aliases[i];↵ | |
3 | if ( alias != null ) {↵ | 3 | if ( alias!=null ) {↵ | |
4 | setters[i] = propertyAccessor.getSetter( resultClass, alias );↵ | 4 | result.put( alias, tuple[i] );↵ | |
5 | }↵ | 5 | ↵ | |
6 | ↵ | 6 | }↵ | |
7 | } | 7 |
| |
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 | 8 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5 | for (int i = 0; i < aliases.length; i++) |
| 2 | for (int i = 0; i < tuple.length; i++) | ||||||||||||||
6 | String alias = aliases[i]; | 3 | String alias = aliases[i]; | |||||||||||||||
7 | if (alias != null) | 4 | if (alias != null) | |||||||||||||||
|
| 5 | result.put(alias, tuple[i]); | |||||||||||||||
8 | setters[i] = propertyAccessor.getSetter(resultClass, alias); |
| |
Row | Violation |
---|---|
1 | Type java.lang.String[] of variable aliases does not match with type java.lang.Object[] of variable tuple |
2 | Unmatched statement result.put(alias,tuple[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement setters[i]=propertyAccessor.getSetter(resultClass,alias); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Clone fragment #1 returns variables i, alias , while Clone fragment #2 returns variables i, alias |