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: IRubyObject getArrayOfSigned16(Ruby, MemoryIO, long, int)
|
Method name: IRubyObject getArrayOfFloat64(Ruby, MemoryIO, long, int)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | short[] array = new short[count];↵ | 1 | double[] array = new double[count];↵ | |
2 | io.get(offset, array, 0, array.length);↵ | 2 | io.get(offset, array, 0, array.length);↵ | |
3 | RubyArray arr = RubyArray.newArray(runtime, array.length);↵ | 3 | RubyArray arr = RubyArray.newArray(runtime, array.length);↵ | |
4 | for (int i = 0; i < array.length; ++i) {↵ | 4 | for (int i = 0; i < array.length; ++i) {↵ | |
5 | arr.add(Util.newSigned16(runtime, array[i]));↵ | 5 | arr.add(RubyFloat.newFloat(runtime, array[i]));↵ | |
6 | }↵ | 6 | }↵ | |
7 | return arr; | 7 |
| |
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 | 20 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | double[] array = new double[count]; | ||||||||||||||||||||||||||
1 | short[] array = new short[count]; | | ||||||||||||||||||||||||||
2 | io.get(offset, array, 0, array.length); |
| 2 | io.get(offset, array, 0, array.length); | ||||||||||||||||||||||||
3 | RubyArray arr = RubyArray.newArray(runtime, array.length); |
| 3 | RubyArray arr = RubyArray.newArray(runtime, array.length); | ||||||||||||||||||||||||
4 | for (int i = 0; i < array.length; ++i) |
| 4 | for (int i = 0; i < array.length; ++i) | ||||||||||||||||||||||||
5 | arr.add(Util.newSigned16(runtime, array[i])); |
| 5 | arr.add(RubyFloat.newFloat(runtime, array[i])); | ||||||||||||||||||||||||
6 | return arr; | 6 | return arr; |
Row | Violation |
---|---|
1 | Type short[] of variable array does not match with type double[] of variable array |
2 | Type short[] of variable array does not match with type double[] of variable array |
3 | Type short[] of variable array does not match with type double[] of variable array |
4 | Expression Util.newSigned16(runtime,array[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression RubyFloat.newFloat(runtime,array[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Type org.jruby.runtime.builtin.IRubyObject of variable Util.newSigned16(runtime,array[i]) does not match with type org.jruby.RubyFloat of variable RubyFloat.newFloat(runtime,array[i]) |
7 | Type short[] of variable array does not match with type double[] of variable array |
8 | Type org.jruby.ext.ffi.Util of variable Util does not match with type org.jruby.RubyFloat of variable RubyFloat |