if ( propertyTypes[i].isComponentType() ) { appendComponentCondition( propertyName, propertyValue, (AbstractComponentType) propertyTypes[i], criteria, criteriaQuery, buf ); } else { appendPropertyCondition( propertyName, propertyValue, criteria, criteriaQuery, buf ); }
if ( isPropertyIncluded(value, subpath, subtype) ) { if ( subtype.isComponentType() ) { addComponentTypedValues(subpath, value, (AbstractComponentType) subtype, list, criteria, criteriaQuery); } else { addPropertyTypedValue(value, subtype, list); } }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/criterion/Example.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/criterion/Example.java
Method name: String toSqlString(Criteria, CriteriaQuery) Method name: void addComponentTypedValues(String, Object, AbstractComponentType, List, Criteria, CriteriaQuery)
Number of AST nodes: 3 Number of AST nodes: 4
1
if ( propertyTypes[i]
1
if ( isPropertyIncluded(value, subpath, subtype) ) {
2
.isComponentType() ) {
2
					if ( subtype.isComponentType() ) {
3
					appendComponentCondition(
3
						addComponent
4
						propertyName,
5
						propertyValue,
6
						(AbstractComponentType) propertyTypes[i],
7
						criteria,
4
TypedValues(subpath, value, (AbstractComponentType) subtype, list, criteria,
8
						criteriaQuery,
5
 criteriaQuery
9
						buf
10
					);
6
);
11
				}
7
					}
12
				else {
8
					else {
13
					appendPropertyCondition(
9
						addProperty
14
						propertyName,
15
						propertyValue,
16
						criteria,
17
						criteriaQuery,
18
						buf
10
TypedValue(value, subtype, list);
19
					);
11
					}
20
				}
12
				}
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 comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    11
    if (propertyTypes[i].isComponentType())
    11
    if (propertyTypes[i].isComponentType())
    10
    if (subtype.isComponentType())
    Differences
    Expression1Expression2Difference
    propertyTypes[i]subtypeTYPE_COMPATIBLE_REPLACEMENT
    10
    if (subtype.isComponentType())
                                                                                                                                                                                                                
    11
    addComponentTypedValues(subpath, value, (AbstractComponentType)subtype, list, criteria, criteriaQuery);
    12
    appendComponentCondition(propertyName, propertyValue, (AbstractComponentType)propertyTypes[i], criteria, criteriaQuery, buf);
                                                                                                                                                                                                                                                            
    else
    else
    13
    appendPropertyCondition(propertyName, propertyValue, criteria, criteriaQuery, buf);
    13
    appendPropertyCondition(propertyName, propertyValue, criteria, criteriaQuery, buf);
    12
    addPropertyTypedValue(value, subtype, list);
    Differences
    Expression1Expression2Difference
    appendPropertyConditionaddPropertyTypedValueMETHOD_INVOCATION_NAME_MISMATCH
    appendPropertyCondition(propertyName,propertyValue,criteria,criteriaQuery,buf)addPropertyTypedValue(value,subtype,list)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression appendPropertyCondition(propertyName,propertyValue,criteria,criteriaQuery,buf) is a void method call, and thus it cannot be parameterized
    Expression addPropertyTypedValue(value,subtype,list) is a void method call, and thus it cannot be parameterized
    Expression appendPropertyCondition(propertyName,propertyValue,criteria,criteriaQuery,buf) is a void method call, and thus it cannot be parameterized
    Expression addPropertyTypedValue(value,subtype,list) is a void method call, and thus it cannot be parameterized
    12
    addPropertyTypedValue(value, subtype, list);
    Precondition Violations (4)
    Row Violation
    1Expression appendPropertyCondition(propertyName,propertyValue,criteria,criteriaQuery,buf) is a void method call, and thus it cannot be parameterized
    2Expression addPropertyTypedValue(value,subtype,list) is a void method call, and thus it cannot be parameterized
    3Expression appendPropertyCondition(propertyName,propertyValue,criteria,criteriaQuery,buf) is a void method call, and thus it cannot be parameterized
    4Expression addPropertyTypedValue(value,subtype,list) is a void method call, and thus it cannot be parameterized