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 | } | |
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 11 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.5 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| 9 | Type subtype = subtypes[i]; | |||||||||||||||||
11 | if (propertyTypes[i].isComponentType()) |
| 10 | if (subtype.isComponentType()) | ||||||||||||||||
12 | appendComponentCondition(propertyName, propertyValue, (AbstractComponentType)propertyTypes[i], criteria, criteriaQuery, buf); |
| 11 | appendComponentCondition(subpath, value, (AbstractComponentType)subtype, criteria, criteriaQuery, buf); | ||||||||||||||||
else | else | |||||||||||||||||||
13 | appendPropertyCondition(propertyName, propertyValue, criteria, criteriaQuery, buf); |
| 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 |