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: 8 | Number of AST nodes: 7 | |||
1 | for (int i=0; i<propertyNames.length; i++) {↵ | |||
2 | Object value = values[i];↵ | |||
3 | Type subtype = subtypes[i];↵ | |||
4 | String subpath = StringHelper.qualify( path, propertyNames[i] );↵ | 1 | String subpath = StringHelper.qualify( path, propertyNames[i] );↵ | |
5 | ↵ | 2 | Object value = values[i];↵ | |
6 | if ( isPropertyIncluded(value, subpath, subtype) ) {↵ | 3 | if ( isPropertyIncluded( value, subpath, subtypes[i] ) ) {↵ | |
7 | ↵ | 4 | Type subtype = subtypes[i];↵ | |
8 | if ( subtype.isComponentType() ) {↵ | 5 | if ( subtype.isComponentType() ) {↵ | |
9 | addComponentTypedValues(subpath, value, ↵ | 6 | appendComponentCondition(↵ | |
7 | subpath,↵ | |||
8 | value,↵ | |||
10 | (AbstractComponentType) subtype, list, ↵ | 9 | (AbstractComponentType) subtype,↵ | |
11 | criteria, ↵ | 10 | criteria,↵ | |
12 | criteriaQuery↵ | 11 | criteriaQuery,↵ | |
12 | buf↵ | |||
13 | );↵ | 13 | );↵ | |
14 | }↵ | 14 | }↵ | |
15 | else {↵ | 15 | else {↵ | |
16 | addPropertyTypedValue(value, subtype, list↵ | 16 | appendPropertyCondition(↵ | |
17 | subpath,↵ | |||
18 | value,↵ | |||
19 | criteria,↵ | |||
20 | criteriaQuery,↵ | |||
21 | buf↵ | |||
17 | );↵ | 22 | );↵ | |
18 | }↵ | 23 | }↵ | |
19 | }↵ | 24 |
| |
20 | } | |||
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.6 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 18 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 2.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6 | Object value = values[i]; | 7 | Object value = values[i]; | ||||||||||||||||||||||
7 | Type subtype = subtypes[i]; |
| | ||||||||||||||||||||||
8 | String subpath = StringHelper.qualify(path, propertyNames[i]); | 6 | String subpath = StringHelper.qualify(path, propertyNames[i]); | ||||||||||||||||||||||
9 | if (isPropertyIncluded(value, subpath, subtype)) |
| 8 | if (isPropertyIncluded(value, subpath, subtypes[i])) | |||||||||||||||||||||
|
| 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 | appendPropertyCondition(subpath, value, criteria, criteriaQuery, buf); |
Row | Violation |
---|---|
1 | 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 |
2 | 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 |
3 | Unmatched statement appendComponentCondition(subpath,value,(AbstractComponentType)subtype,criteria,criteriaQuery,buf); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement addComponentTypedValues(subpath,value,(AbstractComponentType)subtype,list,criteria,criteriaQuery); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Expression addPropertyTypedValue(value,subtype,list) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression appendPropertyCondition(subpath,value,criteria,criteriaQuery,buf) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression addPropertyTypedValue(value,subtype,list) is a void method call, and thus it cannot be parameterized |
8 | Expression appendPropertyCondition(subpath,value,criteria,criteriaQuery,buf) is a void method call, and thus it cannot be parameterized |
9 | Expression addPropertyTypedValue(value,subtype,list) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression appendPropertyCondition(subpath,value,criteria,criteriaQuery,buf) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression addPropertyTypedValue(value,subtype,list) is a void method call, and thus it cannot be parameterized |
12 | Expression appendPropertyCondition(subpath,value,criteria,criteriaQuery,buf) is a void method call, and thus it cannot be parameterized |
13 | Clone fragment #1 returns variables value, subpath , while Clone fragment #2 returns variables subpath, value |