for (Iterator itr = getDialect().getFunctions().entrySet().iterator(); itr.hasNext(); ) {
final Map.Entry entry = (Map.Entry) itr.next();
final SQLFunction function = (SQLFunction) entry.getValue();
if ( !function.hasArguments() && !function.hasParenthesesIfNoArguments() ) {
return (String) entry.getKey();
}
}
return null;
for (Iterator itr = getDialect().getFunctions().entrySet().iterator(); itr.hasNext(); ) {
final Map.Entry entry = (Map.Entry) itr.next();
final SQLFunction function = (SQLFunction) entry.getValue();
if ( !function.hasArguments() && !function.hasParenthesesIfNoArguments() ) {
return (String) entry.getKey();
}
}
return null;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/dialect/functional/cache/SQLFunctionsInterSystemsTest.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/legacy/SQLFunctionsTest.java
|
Method name: String locateAppropriateDialectFunctionNameForAliasTest()
|
|
Method name: String locateAppropriateDialectFunctionNameForAliasTest()
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | for (Iterator itr = getDialect().getFunctions().entrySet().iterator(); itr.hasNext(); ) {
↵ | | 1 | for (Iterator itr = getDialect().getFunctions().entrySet().iterator(); itr.hasNext(); ) {↵
|
2 | final Map.Entry entry = (Map.Entry) itr.next();
↵ | | 2 | final Map.Entry entry = (Map.Entry) itr.next();↵
|
3 | final SQLFunction function = (SQLFunction) entry.getValue();
↵ | | 3 | final SQLFunction function = (SQLFunction) entry.getValue();↵
|
4 | if ( !function.hasArguments() && !function.hasParenthesesIfNoArguments() ) {
↵ | | 4 | if ( !function.hasArguments() && !function.hasParenthesesIfNoArguments() ) {↵
|
5 | return (String) entry.getKey();
↵ | | 5 | return (String) entry.getKey();↵
|
6 | }
↵ | | 6 | }↵
|
7 | }
↵ | | 7 | }↵
|
8 | return null; | | 8 | return null;
|
See real code fragment |
|
See real code fragment |
Summary
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.5 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 14 |
-
{Refactorable}
Mapping Summary
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.0 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | for (Iterator itr = getDialect().getFunctions().entrySet().iterator(); itr.hasNext(); ) | | 1 | for (Iterator itr = getDialect().getFunctions().entrySet().iterator(); itr.hasNext(); ) |
2 | final Map.Entry entry = (Map.Entry)itr.next(); | | 2 | final Map.Entry entry = (Map.Entry)itr.next(); |
3 | final SQLFunction function = (SQLFunction)entry.getValue(); | | 3 | final SQLFunction function = (SQLFunction)entry.getValue(); |
4 | if (!function.hasArguments() && !function.hasParenthesesIfNoArguments()) | | 4 | if (!function.hasArguments() && !function.hasParenthesesIfNoArguments()) |
5 | return (String)entry.getKey(); | | 5 | return (String)entry.getKey(); |
6 | return null; | | 6 | return null; |
Precondition Violations (0)
Row |
Violation |