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
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are declared in the same class
Number of node comparisons20
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (queryableCollection == null)
    1
    if (queryableCollection == null)
    2
    return "";
    2
    return "";
    else
    else
    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(getCollectionTableAlias(), collectionSuffix);
    5
    String fragment = queryableCollection.selectFragment(getTableAlias(), collectionSuffix);
    Differences
    Expression1Expression2Difference
    getCollectionTableAliasgetTableAliasMETHOD_INVOCATION_NAME_MISMATCH
    5
    String fragment = queryableCollection.selectFragment(getTableAlias(), collectionSuffix);
    6
    return trimLeadingCommaAndSpaces(fragment);
    6
    return trimLeadingCommaAndSpaces(fragment);
    Precondition Violations (0)
    Row Violation