if ( projectionTypes.length != 1 ) { //should never happen, i think throw new QueryException( "not a single-length projection: " + propertyName ); } return projectionTypes[0];
if ( columns.length != 1 ) { throw new QueryException( "path expression ends in a composite value: " + path ); } return columns[0];
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/hql/classic/PathExpressionParser.java
Method name: Type getTypeUsingProjection(Criteria, String) Method name: String getWhereColumn()
Number of AST nodes: 3 Number of AST nodes: 3
1
if ( projectionTypes.length != 1 ) {
1
if ( columns.length != 1 ) {
2
				//should never happen, i think
2
			
3
				throw new QueryException( "not a single-length projection: " + propertyName );
3
throw new QueryException( "path expression ends in a composite value: " + path );
4
			}
4
		}
5
			return projectionTypes[0];
5
		return columns[0];
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.1
Clones locationClones are in different classes
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    6
    if (projectionTypes.length != 1)
    6
    if (projectionTypes.length != 1)
    1
    if (columns.length != 1)
    Differences
    Expression1Expression2Difference
    projectionTypescolumnsVARIABLE_NAME_MISMATCH
    org.hibernate.type.Type[]java.lang.String[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.type.Type[] of variable projectionTypes does not match with type java.lang.String[] of variable columns
    • Make classes org.hibernate.type.Type[] and java.lang.String[] extend a common superclass
    1
    if (columns.length != 1)
                                                                                                                                                                        
    2
    throw new QueryException("path expression ends in a composite value: " + path);
    Preondition Violations
    Unmatched throw new QueryException("path expression ends in a composite value: " + path);
    2
    throw new QueryException("path expression ends in a composite value: " + path);
    7
    throw new QueryException("not a single-length projection: " + propertyName);
    7
    throw new QueryException("not a single-length projection: " + propertyName);
    Preondition Violations
    Unmatched throw new QueryException("not a single-length projection: " + propertyName);
                                                                                                                                                                  
                                              
    3
    return columns[0];
    Preondition Violations
    Unmatched return columns[0];
    3
    return columns[0];
    8
    return projectionTypes[0];
    8
    return projectionTypes[0];
    Preondition Violations
    Unmatched return projectionTypes[0];
                                                              
    Precondition Violations (5)
    Row Violation
    1Type org.hibernate.type.Type[] of variable projectionTypes does not match with type java.lang.String[] of variable columns
    2Unmatched throw new QueryException("path expression ends in a composite value: " + path);
    3Unmatched throw new QueryException("not a single-length projection: " + propertyName);
    4Unmatched return columns[0];
    5Unmatched return projectionTypes[0];