File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/sql/Alias.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/util/ArrayHelper.java | |||
Method name: String[] toAliasStrings(String[])
|
Method name: String[] toStringArray(Object[])
|
|||
Number of AST nodes: 4 | Number of AST nodes: 5 | |||
1 | int length=objects.length;↵ | |||
1 | String[] aliases = new String[ sqlIdentifiers.length ];↵ | 2 | String[] result = new String[length];↵ | |
2 | for ( int i=0; i<sqlIdentifiers.length; i++ ) {↵ | 3 | for (int i=0; i<length; i++) {↵ | |
3 | aliases[i] = toAliasString(sqlIdentifiers[i]);↵ | 4 | result[i] = objects[i].toString();↵ | |
4 | }↵ | 5 | }↵ | |
5 | return aliases; | 6 | return result; | |
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 | 10 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.9 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | int length = objects.length; | |||||||||||||||||||||||||
1 | String[] aliases = new String[sqlIdentifiers.length]; |
| 2 | String[] result = new String[length]; | |||||||||||||||||||||||
2 | for (int i = 0; i < sqlIdentifiers.length; i++) |
| 3 | for (int i = 0; i < length; i++) | |||||||||||||||||||||||
3 | aliases[i] = toAliasString(sqlIdentifiers[i]); |
| 4 | result[i] = objects[i].toString(); | |||||||||||||||||||||||
4 | return aliases; |
| 5 | return result; |
Row | Violation |
---|---|
1 | Expression toAliasString(sqlIdentifiers[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression objects[i].toString() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression toAliasString(sqlIdentifiers[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression objects[i].toString() cannot be parameterized, because it has dependencies to/from statements that will be extracted |