if ( isPropertyIncluded(value, subpath, subtype) ) { if ( subtype.isComponentType() ) { addComponentTypedValues(subpath, value, (AbstractComponentType) subtype, list, criteria, criteriaQuery); } else { addPropertyTypedValue(value, subtype, list); } }
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: void addComponentTypedValues(String, Object, AbstractComponentType, List, Criteria, CriteriaQuery) Method name: void appendComponentCondition(String, Object, AbstractComponentType, Criteria, CriteriaQuery, StringBuffer)
Number of AST nodes: 4 Number of AST nodes: 4
1
if ( isPropertyIncluded(value, subpath, subtype) ) {
1
Type subtype = subtypes[i];
2
					if ( subtype.isComponentType() ) {
2
					if ( subtype.isComponentType() ) {
3
						addComponentTypedValues(subpath, value, 
3
						appendComponentCondition(
4
							subpath,
5
							value,
4
(AbstractComponentType) subtype, list, 
6
							(AbstractComponentType) subtype,
5
criteria, 
7
							criteria,
6
criteriaQuery
8
							criteriaQuery,
9
							buf
7
);
10
						);
8
					}
11
					}
9
					else {
12
					else {
10
						addPropertyTypedValue(value, subtype, list);
13
						appendPropertyCondition(
14
							subpath,
15
							value,
16
							criteria,
17
							criteriaQuery,
18
							buf
11
					}
19
					
20
	);
12
				}
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 statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)424.0
    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];
    10
    if (subtype.isComponentType())
    10
    if (subtype.isComponentType())
                                                                                                                                                                                                                
    11
    appendComponentCondition(subpath, value, (AbstractComponentType)subtype, criteria, criteriaQuery, buf);
    11
    addComponentTypedValues(subpath, value, (AbstractComponentType)subtype, list, criteria, criteriaQuery);
                                                                                                                                                                                                                
    else
    else
    12
    addPropertyTypedValue(value, subtype, list);
    12
    addPropertyTypedValue(value, subtype, list);
    12
    appendPropertyCondition(subpath, value, criteria, criteriaQuery, buf);
    Differences
    Expression1Expression2Difference
    addPropertyTypedValueappendPropertyConditionMETHOD_INVOCATION_NAME_MISMATCH
    addPropertyTypedValue(value,subtype,list)appendPropertyCondition(subpath,value,criteria,criteriaQuery,buf)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression addPropertyTypedValue(value,subtype,list) is a void method call, and thus it cannot be parameterized
    Expression appendPropertyCondition(subpath,value,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(subpath,value,criteria,criteriaQuery,buf) is a void method call, and thus it cannot be parameterized
    12
    appendPropertyCondition(subpath, value, criteria, criteriaQuery, buf);
    Precondition Violations (5)
    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
    2Expression addPropertyTypedValue(value,subtype,list) is a void method call, and thus it cannot be parameterized
    3Expression appendPropertyCondition(subpath,value,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
    5Expression appendPropertyCondition(subpath,value,criteria,criteriaQuery,buf) is a void method call, and thus it cannot be parameterized