String[] aliases = new String[ sqlIdentifiers.length ];
for ( int i=0; i<sqlIdentifiers.length; i++ ) {
aliases[i] = toUnquotedAliasString(sqlIdentifiers[i]);
}
return aliases;
String[] aliases = new String[ sqlIdentifiers.length ];
for ( int i=0; i<sqlIdentifiers.length; i++ ) {
aliases[i] = toAliasString(sqlIdentifiers[i]);
}
return aliases;
Clone fragments detected by clone detection tool
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/sql/Alias.java
|
Method name: String[] toUnquotedAliasStrings(String[])
|
|
Method name: String[] toAliasStrings(String[])
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | String[] aliases = new String[ sqlIdentifiers.length ];↵ | | 1 | String[] aliases = new String[ sqlIdentifiers.length ];↵
|
2 | for ( int i=0; i<sqlIdentifiers.length; i++ ) {↵ | | 2 | for ( int i=0; i<sqlIdentifiers.length; i++ ) {↵
|
3 | aliases[i] = toUnquotedAliasString(sqlIdentifiers[i]);↵ | | 3 | aliases[i] = toAliasString(sqlIdentifiers[i]);↵
|
4 | }↵ | | 4 | }↵
|
5 | return aliases; | | 5 | return aliases;
|
See real code fragment |
|
See real code fragment |
Summary
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 declared in the same class |
Number of node comparisons | 8 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 0.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | String[] aliases = new String[sqlIdentifiers.length]; | | 1 | String[] aliases = new String[sqlIdentifiers.length]; |
2 | for (int i = 0; i < sqlIdentifiers.length; i++) | | 2 | for (int i = 0; i < sqlIdentifiers.length; i++) |
3 | aliases[i] = toUnquotedAliasString(sqlIdentifiers[i]); | | 3 | aliases[i] = toAliasString(sqlIdentifiers[i]); |
4 | return aliases; | | 4 | return aliases; |
Precondition Violations (2)
Row |
Violation |
1 | Expression toUnquotedAliasString(sqlIdentifiers[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression toAliasString(sqlIdentifiers[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted |