if ( propertyName.indexOf( '.' ) > 0 ) { String root = StringHelper.root( propertyName ); Criteria crit = getAliasedCriteria( root ); if ( crit != null ) { return getEntityName( crit ); } } return getEntityName( subcriteria );
if ( propertyName.indexOf( '.' ) > 0 ) { String root = StringHelper.root( propertyName ); Criteria subcriteria = getAliasedCriteria( root ); if ( subcriteria != null ) { return getSQLAlias( subcriteria ); } } return getSQLAlias( criteria );
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/loader/criteria/CriteriaQueryTranslator.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/loader/criteria/CriteriaQueryTranslator.java
Method name: String getEntityName(Criteria, String) Method name: String getSQLAlias(Criteria, String)
Number of AST nodes: 6 Number of AST nodes: 6
1
if ( propertyName.indexOf( '.' ) > 0 ) {
1
if ( propertyName.indexOf( '.' ) > 0 ) {
2
			String root = StringHelper.root( propertyName );
2
			String root = StringHelper.root( propertyName );
3
			Criteria crit = getAliasedCriteria( root );
3
			Criteria subcriteria = getAliasedCriteria( root );
4
			if ( crit != null ) {
4
			if ( subcriteria != null ) {
5
				return getEntityName( crit );
5
				return getSQLAlias( subcriteria );
6
			}
6
			}
7
		}
7
		}
8
		return getEntityName( subcriteria );
8
		return getSQLAlias( criteria );
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are declared in the same class
Number of node comparisons14
  1. {Non-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 (propertyName.indexOf('.') > 0)
    1
    if (propertyName.indexOf('.') > 0)
    2
    String root = StringHelper.root(propertyName);
    2
    String root = StringHelper.root(propertyName);
    3
    Criteria crit = getAliasedCriteria(root);
    3
    Criteria crit = getAliasedCriteria(root);
    3
    Criteria subcriteria = getAliasedCriteria(root);
    Differences
    Expression1Expression2Difference
    critsubcriteriaVARIABLE_NAME_MISMATCH
    3
    Criteria subcriteria = getAliasedCriteria(root);
    4
    if (crit != null)
    4
    if (crit != null)
    4
    if (subcriteria != null)
    Differences
    Expression1Expression2Difference
    critsubcriteriaVARIABLE_NAME_MISMATCH
    4
    if (subcriteria != null)
    5
    return getEntityName(crit);
    5
    return getEntityName(crit);
    5
    return getSQLAlias(subcriteria);
    Differences
    Expression1Expression2Difference
    getEntityNamegetSQLAliasMETHOD_INVOCATION_NAME_MISMATCH
    critsubcriteriaVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression getEntityName(crit) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression getSQLAlias(subcriteria) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    return getSQLAlias(subcriteria);
    6
    return getEntityName(subcriteria);
    6
    return getEntityName(subcriteria);
    6
    return getSQLAlias(criteria);
    Differences
    Expression1Expression2Difference
    getEntityNamegetSQLAliasMETHOD_INVOCATION_NAME_MISMATCH
    subcriteriacriteriaVARIABLE_NAME_MISMATCH
    6
    return getSQLAlias(criteria);
    Precondition Violations (2)
    Row Violation
    1Expression getEntityName(crit) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression getSQLAlias(subcriteria) cannot be parameterized, because it has dependencies to/from statements that will be extracted