File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/type/ComponentType.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/util/StringHelper.java | |||
Method name: int[] sqlTypes(Mapping)
|
Method name: String[] multiply(String[], String, String[])
|
|||
Number of AST nodes: 4 | Number of AST nodes: 3 | |||
1 | for ( int i = 0; i < propertySpan; i++ ) {↵ | 1 | for ( int i = 0; i < ↵ | |
2 | int[] subtypes = propertyTypes[i].sqlTypes( mapping );↵ | 2 | replacements.length; i++ ) {↵ | |
3 | for ( int j = 0; j < subtypes.length; j++ ) {↵ | 3 | for ( int j = 0; j < strings.length; j++ ) {↵ | |
4 | sqlTypes[n++] = subtypes[j];↵ | 4 | results[n++] = replaceOnce( strings[j], placeholder, replacements[i] );↵ | |
5 | }↵ | 5 | }↵ | |
6 | } | 6 |
| |
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.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 7 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.8 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | for (int i = 0; i < propertySpan; i++) |
| 3 | for (int i = 0; i < replacements.length; i++) | ||||||||||||||
4 | int[] subtypes = propertyTypes[i].sqlTypes(mapping); |
| | |||||||||||||||
5 | for (int j = 0; j < subtypes.length; j++) |
| 4 | for (int j = 0; j < strings.length; j++) | ||||||||||||||
|
| 5 | results[n++] = replaceOnce(strings[j], placeholder, replacements[i]); | |||||||||||||||
6 | sqlTypes[n++] = subtypes[j]; |
| |
Row | Violation |
---|---|
1 | Unmatched statement int[] subtypes=propertyTypes[i].sqlTypes(mapping); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement int[] subtypes=propertyTypes[i].sqlTypes(mapping); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
3 | Type int of variable subtypes.length does not match with type int of variable strings.length |
4 | Unmatched statement results[n++]=replaceOnce(strings[j],placeholder,replacements[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement sqlTypes[n++]=subtypes[j]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Clone fragment #1 returns variables i, j , while Clone fragment #2 returns variables i, j |