if ( propertyTypes[i].isComponentType() ) { appendComponentCondition( propertyName, propertyValue, (AbstractComponentType) propertyTypes[i], criteria, criteriaQuery, buf ); } else { appendPropertyCondition( propertyName, propertyValue, criteria, criteriaQuery, buf ); }
Type subtype = subtypes[i]; if ( subtype.isComponentType() ) { appendComponentCondition( subpath, value, (AbstractComponentType) subtype, criteria, criteriaQuery, buf ); } else { appendPropertyCondition( subpath, value, criteria, criteriaQuery, buf ); }
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 appendComponentCondition(String, Object, AbstractComponentType, Criteria, CriteriaQuery, StringBuffer)
Number of AST nodes: 3 Number of AST nodes: 4
1
if ( propertyTypes[i]
1
Type subtype = subtypes[i];
2
.isComponentType() ) {
2
					if ( subtype.isComponentType() ) {
3
					appendComponentCondition(
3
						appendComponentCondition(
4
						propertyName,
4
						
5
						propertyV
5
	subpath,
6
alue,
6
							value,
7
						(AbstractComponentType) propertyTypes[i],
7
							(AbstractComponentType) subtype,
8
						criteria,
8
							criteria,
9
						criteriaQuery,
9
							criteriaQuery,
10
						buf
10
							buf
11
					);
11
						);
12
				}
12
					}
13
				else {
13
					else {
14
					appendPropertyCondition(
14
						appendPropertyCondition(
15
						propertyName,
15
							subpath,
16
						propertyValue,
16
							value,
17
						criteria,
17
							criteria,
18
						criteriaQuery,
18
							criteriaQuery,
19
						buf
19
							buf
20
					);
20
						);
21
				}
21
					}
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 comparisons11
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.5
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                            
    9
    Type subtype = subtypes[i];
    Preondition Violations
    Unmatched statement Type subtype=subtypes[i]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    9
    Type subtype = subtypes[i];
    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())
    12
    appendComponentCondition(propertyName, propertyValue, (AbstractComponentType)propertyTypes[i], criteria, criteriaQuery, buf);
    12
    appendComponentCondition(propertyName, propertyValue, (AbstractComponentType)propertyTypes[i], criteria, criteriaQuery, buf);
    11
    appendComponentCondition(subpath, value, (AbstractComponentType)subtype, criteria, criteriaQuery, buf);
    Differences
    Expression1Expression2Difference
    propertyNamesubpathVARIABLE_NAME_MISMATCH
    propertyValuevalueVARIABLE_NAME_MISMATCH
    propertyTypes[i]subtypeTYPE_COMPATIBLE_REPLACEMENT
    11
    appendComponentCondition(subpath, value, (AbstractComponentType)subtype, criteria, criteriaQuery, buf);
    else
    else
    13
    appendPropertyCondition(propertyName, propertyValue, criteria, criteriaQuery, buf);
    13
    appendPropertyCondition(propertyName, propertyValue, criteria, criteriaQuery, buf);
    12
    appendPropertyCondition(subpath, value, criteria, criteriaQuery, buf);
    Differences
    Expression1Expression2Difference
    propertyNamesubpathVARIABLE_NAME_MISMATCH
    propertyValuevalueVARIABLE_NAME_MISMATCH
    12
    appendPropertyCondition(subpath, value, criteria, criteriaQuery, buf);
    Precondition Violations (1)
    Row Violation
    1Unmatched statement Type subtype=subtypes[i]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted