File path: /jruby-1.4.0/src/org/jruby/ext/ffi/MemoryUtil.java | File path: /jruby-1.4.0/src/org/jruby/ext/ffi/MemoryUtil.java | |||
Method name: void putArrayOfFloat64(Ruby, MemoryIO, long, RubyArray)
|
Method name: void putArrayOfUnsigned16(Ruby, MemoryIO, long, RubyArray)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | double[] array = new double[ary.size()];↵ | 1 | short[] array = new short[ary.size()];↵ | |
2 | for (int i = 0; i < array.length; ++i) {↵ | 2 | for (int i = 0; i < array.length; ++i) {↵ | |
3 | array[i] = Util.doubleValue(ary.entry(i));↵ | 3 | array[i] = (short) Util.uint16Value(ary.entry(i));↵ | |
4 | }↵ | 4 | }↵ | |
5 | io.put(offset, array, 0, array.length); | 5 |
| |
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 | 8 |
Number of mapped statements | 2 |
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) | 0.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | short[] array = new short[ary.size()]; | |||||||||||||
1 | double[] array = new double[ary.size()]; | | |||||||||||||
2 | for (int i = 0; i < array.length; ++i) |
| 2 | for (int i = 0; i < array.length; ++i) | |||||||||||
|
| 3 | array[i] = (short)Util.uint16Value(ary.entry(i)); | ||||||||||||
3 | array[i] = Util.doubleValue(ary.entry(i)); |
| | ||||||||||||
4 | io.put(offset, array, 0, array.length); |
| 4 | io.put(offset, array, 0, array.length); |
Row | Violation |
---|---|
1 | Type double[] of variable array does not match with type short[] of variable array |
2 | Unmatched statement array[i]=(short)Util.uint16Value(ary.entry(i)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement array[i]=Util.doubleValue(ary.entry(i)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Type double[] of variable array does not match with type short[] of variable array |