Type type = parameterMetadata.getNamedParameterExpectedType( paramName ); if ( type == null ) { type = guessType( paramValue ); } return type;
Type type = parameterMetadata.getNamedParameterExpectedType( paramName ); if ( type == null ) { type = guessType( clazz ); } return type;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/impl/AbstractQueryImpl.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/impl/AbstractQueryImpl.java
Method name: Type determineType(String, Object) Method name: Type determineType(String, Class)
Number of AST nodes: 4 Number of AST nodes: 4
1
Type type = parameterMetadata.getNamedParameterExpectedType( paramName );
1
Type type = parameterMetadata.getNamedParameterExpectedType( paramName );
2
		if ( type == null ) {
2
		if ( type == null ) {
3
			type = guessType( paramValue );
3
			type = guessType( clazz );
4
		}
4
		}
5
		return type;
5
		return type;
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 declared in the same class
Number of node comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Type type = parameterMetadata.getNamedParameterExpectedType(paramName);
    1
    Type type = parameterMetadata.getNamedParameterExpectedType(paramName);
    2
    if (type == null)
    2
    if (type == null)
    3
    type = guessType(paramValue);
    3
    type = guessType(paramValue);
    3
    type = guessType(clazz);
    Differences
    Expression1Expression2Difference
    paramValueclazzVARIABLE_NAME_MISMATCH
    java.lang.Objectjava.lang.ClassVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.Object of variable paramValue does not match with type java.lang.Class of variable clazz
    • Make classes java.lang.Object and java.lang.Class extend a common superclass
    3
    type = guessType(clazz);
    4
    return type;
    4
    return type;
    Precondition Violations (1)
    Row Violation
    1Type java.lang.Object of variable paramValue does not match with type java.lang.Class of variable clazz