File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/tuple/component/AbstractComponentTuplizer.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/util/ArrayHelper.java | |||
Method name: Object[] getPropertyValues(Object)
|
Method name: String[] slice(String[], int, int)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | Object[] values = new Object[propertySpan]; ↵ | 1 | String[] result = new String[length];↵ | |
2 | for ( int i = 0; i < propertySpan; i++ ) { ↵ | 2 | for ( int i=0; i<length; i++ ) {↵ | |
3 | values[i] = getPropertyValue( component, i ); ↵ | 3 | result[i] = strings[begin+i];↵ | |
4 | } ↵ | 4 | }↵ | |
5 | return values; | 5 | return result; | |
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 in different classes |
Number of node comparisons | 8 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 0.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | String[] result = new String[length]; | ||||||||||||
1 | Object[] values = new Object[propertySpan]; | | ||||||||||||
2 | for (int i = 0; i < propertySpan; i++) |
| 2 | for (int i = 0; i < length; i++) | ||||||||||
|
| 3 | result[i] = strings[begin + i]; | |||||||||||
3 | values[i] = getPropertyValue(component, i); |
| | |||||||||||
|
| 4 | return result; | |||||||||||
4 | return values; |
| |
Row | Violation |
---|---|
1 | Unmatched statement result[i]=strings[begin + i]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement values[i]=getPropertyValue(component,i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched return result; |
4 | Unmatched return values; |