if(transformer==null) { return row; } else { return transformer.transformTuple(row, queryReturnAliases); }
if ( customSql == null ) { return COUNT; } else { return callable ? PARAM : COUNT; }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/hql/HolderInstantiator.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/ExecuteUpdateResultCheckStyle.java
Method name: Object instantiate(Object[]) Method name: ExecuteUpdateResultCheckStyle determineDefault(String, boolean)
Number of AST nodes: 3 Number of AST nodes: 3
1
if(transformer==null) {
1
if ( customSql == null ) {
2
			return row;
2
			return 
3
		} 
3
COUNT;
4
		}
4
else {
5
		else {
5
			return transformer.transformTuple(row, queryReturnAliases);
6
			return callable ? PARAM : COUNT;
6
		}
7
		}
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 in different classes
Number of node comparisons9
  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.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (transformer == null)
    1
    if (transformer == null)
    1
    if (customSql == null)
    Differences
    Expression1Expression2Difference
    transformercustomSqlVARIABLE_NAME_MISMATCH
    org.hibernate.transform.ResultTransformerjava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.transform.ResultTransformer of variable transformer does not match with type java.lang.String of variable customSql
    • Make classes org.hibernate.transform.ResultTransformer and java.lang.String extend a common superclass
    1
    if (customSql == null)
                                    
    2
    return COUNT;
    Preondition Violations
    Unmatched return COUNT;
    2
    return COUNT;
    2
    return row;
    2
    return row;
    Preondition Violations
    Unmatched return row;
                                
    else
            
                                                                          
    3
    return callable ? PARAM : COUNT;
    Preondition Violations
    Unmatched return callable ? PARAM : COUNT;
    3
    return callable ? PARAM : COUNT;
    3
    return transformer.transformTuple(row, queryReturnAliases);
    3
    return transformer.transformTuple(row, queryReturnAliases);
    Preondition Violations
    Unmatched return transformer.transformTuple(row,queryReturnAliases);
                                                                                                                              
    Precondition Violations (5)
    Row Violation
    1Type org.hibernate.transform.ResultTransformer of variable transformer does not match with type java.lang.String of variable customSql
    2Unmatched return COUNT;
    3Unmatched return row;
    4Unmatched return callable ? PARAM : COUNT;
    5Unmatched return transformer.transformTuple(row,queryReturnAliases);