if ( queryableCollection == null ) {
return "";
}
else {
if ( collectionSuffix == null ) {
collectionSuffix = generateSuffix( size, k );
}
String fragment = queryableCollection.selectFragment( getCollectionTableAlias(), collectionSuffix );
return trimLeadingCommaAndSpaces( fragment );
}
if ( queryableCollection == null ) {
return "";
}
else {
if ( collectionSuffix == null ) {
collectionSuffix = generateSuffix( size, k );
}
String fragment = queryableCollection.selectFragment( getTableAlias(), collectionSuffix );
return trimLeadingCommaAndSpaces( fragment );
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/hql/ast/tree/FromElementType.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/hql/ast/tree/FromElementType.java
|
Method name: String renderCollectionSelectFragment(int, int)
|
|
Method name: String renderValueCollectionSelectFragment(int, int)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | if ( queryableCollection == null ) {↵ | | 1 | if ( queryableCollection == null ) {↵
|
2 | return "";↵ | | 2 | return "";↵
|
3 | }↵ | | 3 | }↵
|
4 | else {↵ | | 4 | else {↵
|
5 | if ( collectionSuffix == null ) {↵ | | 5 | if ( collectionSuffix == null ) {↵
|
6 | collectionSuffix = generateSuffix( size, k );↵ | | 6 | collectionSuffix = generateSuffix( size, k );↵
|
7 | }↵ | | 7 | }↵
|
8 | String fragment = queryableCollection.selectFragment( getCollectionTableAlias(), collectionSuffix );↵ | | 8 | String fragment = queryableCollection.selectFragment( getTableAlias(), collectionSuffix );↵
|
9 | return trimLeadingCommaAndSpaces( fragment );↵ | | 9 | return trimLeadingCommaAndSpaces( fragment );↵
|
10 | } | | 10 | }
|
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 20 |
-
{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.2 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (queryableCollection == null) | | 1 | if (queryableCollection == null) |
2 | | | 2 | |
| | | | |
3 | if (collectionSuffix == null) | | 3 | if (collectionSuffix == null) |
4 | collectionSuffix = generateSuffix(size, k); | | 4 | collectionSuffix = generateSuffix(size, k); |
5 | String fragment = queryableCollection.selectFragment(getCollectionTableAlias(), collectionSuffix); | | 5 | String fragment = queryableCollection.selectFragment(getTableAlias(), collectionSuffix); |
6 | return trimLeadingCommaAndSpaces(fragment); | | 6 | return trimLeadingCommaAndSpaces(fragment); |
Precondition Violations (0)
Row |
Violation |