Object propertyValue = propertyValues[i]; String propertyName = propertyNames[i]; boolean isPropertyIncluded = i!=meta.getVersionProperty() && isPropertyIncluded( propertyValue, propertyName, propertyTypes[i] ); if (isPropertyIncluded) { if ( propertyTypes[i].isComponentType() ) { appendComponentCondition( propertyName, propertyValue, (AbstractComponentType) propertyTypes[i], criteria, criteriaQuery, buf );
String subpath = StringHelper.qualify( path, propertyNames[i] ); Object value = values[i]; if ( isPropertyIncluded( value, subpath, subtypes[i] ) ) { Type subtype = subtypes[i]; if ( subtype.isComponentType() ) { appendComponentCondition( subpath, value, (AbstractComponentType) subtype, 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: 4 Number of AST nodes: 4
1
Object propertyValue = propertyValues[i];
2
			String propertyName = propertyNames[i];
1
String subpath = StringHelper.qualify( path, propertyNames[i] );
3
			boolean isPropertyIncluded = i!=meta.getVersionProperty() &&
2
				
4
				
3
Object value = values[i];
5
isPropertyIncluded( propertyValue, propertyName, propertyTypes[i] );
4
				if ( isPropertyIncluded( 
6
			if (isPropertyIncluded) {
7
				if ( propertyTypes[i]
5
value, subpath, subtypes[i] ) ) {
6
					Type subtype = subtypes[i];
8
.isComponentType() ) {
7
					if ( subtype.isComponentType() ) {
9
					appendComponentCondition(
8
						appendComponentCondition(
10
						propertyName,
9
						
11
						propertyV
10
	subpath,
12
alue,
11
							value,
13
						(AbstractComponentType) propertyTypes[i],
12
							(AbstractComponentType) subtype,
14
						criteria,
13
							criteria,
15
						criteriaQuery,
14
							criteriaQuery,
16
						buf
15
							buf
17
					);
16
						);
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.0
Clones locationClones are declared in the same class
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    7
    Object propertyValue = propertyValues[i];
    7
    Object propertyValue = propertyValues[i];
    7
    Object value = values[i];
    Differences
    Expression1Expression2Difference
    propertyValuevalueVARIABLE_NAME_MISMATCH
    propertyValuesvaluesVARIABLE_NAME_MISMATCH
    7
    Object value = values[i];
    8
    String propertyName = propertyNames[i];
    8
    String propertyName = propertyNames[i];
    6
    String subpath = StringHelper.qualify(path, propertyNames[i]);
    Differences
    Expression1Expression2Difference
    propertyNamesubpathVARIABLE_NAME_MISMATCH
    propertyNames[i]StringHelper.qualify(path,propertyNames[i])TYPE_COMPATIBLE_REPLACEMENT
    6
    String subpath = StringHelper.qualify(path, propertyNames[i]);
    9
    boolean isPropertyIncluded = i != meta.getVersionProperty() && isPropertyIncluded(propertyValue, propertyName, propertyTypes[i]);
    9
    boolean isPropertyIncluded = i != meta.getVersionProperty() && isPropertyIncluded(propertyValue, propertyName, propertyTypes[i]);
    Preondition Violations
    Unmatched statement boolean isPropertyIncluded=i != meta.getVersionProperty() && isPropertyIncluded(propertyValue,propertyName,propertyTypes[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                                                                                                                                    
    10
    if (isPropertyIncluded)
    10
    if (isPropertyIncluded)
    8
    if (isPropertyIncluded(value, subpath, subtypes[i]))
    Differences
    Expression1Expression2Difference
    isPropertyIncludedisPropertyIncluded(value,subpath,subtypes[i])TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression isPropertyIncluded cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression isPropertyIncluded(value,subpath,subtypes[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method isPropertyIncluded
    8
    if (isPropertyIncluded(value, subpath, subtypes[i]))
                                                            
    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
    Preondition Violations
    Expression subtype cannot be parameterized, because it has dependencies to/from statements that will be extracted
    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
    Preondition Violations
    Expression propertyTypes[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression subtype cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11
    appendComponentCondition(subpath, value, (AbstractComponentType)subtype, criteria, criteriaQuery, buf);
    Precondition Violations (8)
    Row Violation
    1Unmatched statement boolean isPropertyIncluded=i != meta.getVersionProperty() && isPropertyIncluded(propertyValue,propertyName,propertyTypes[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Expression isPropertyIncluded cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression isPropertyIncluded(value,subpath,subtypes[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Unmatched 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
    5Expression subtype cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression propertyTypes[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression subtype cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Clone fragment #1 returns variables propertyValue, propertyName , while Clone fragment #2 returns variables subpath, value