int[] array = new int[ary.size()]; for (int i = 0; i < array.length; ++i) { array[i] = Util.int32Value(ary.entry(i)); } io.put(offset, array, 0, array.length);
int[] array = new int[ary.size()]; for (int i = 0; i < array.length; ++i) { array[i] = (int) Util.uint32Value(ary.entry(i)); } io.put(offset, array, 0, array.length);
Clone fragments detected by clone detection tool
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 putArrayOfSigned32(Ruby, MemoryIO, long, RubyArray) Method name: void putArrayOfUnsigned32(Ruby, MemoryIO, long, RubyArray)
Number of AST nodes: 4 Number of AST nodes: 4
1
int[] array = new int[ary.size()];
1
int[] array = new int[ary.size()];
2
        for (int i = 0; i < array.length; ++i) {
2
        for (int i = 0; i < array.length; ++i) {
3
            array[i] = Util.int32Value(ary.entry(i));
3
            array[i] = (int) Util.uint32Value(ary.entry(i));
4
        }
4
        }
5
        io.put(offset, array, 0, array.length);
5
        io.put(offset, array, 0, array.length);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are declared in the same class
Number of node comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    int[] array = new int[ary.size()];
    1
    int[] array = new int[ary.size()];
    2
    for (int i = 0; i < array.length; ++i)
    2
    for (int i = 0; i < array.length; ++i)
    3
    array[i] = Util.int32Value(ary.entry(i));
    3
    array[i] = Util.int32Value(ary.entry(i));
    3
    array[i] = (int)Util.uint32Value(ary.entry(i));
    Differences
    Expression1Expression2Difference
    Util.int32Value(ary.entry(i))(int)Util.uint32Value(ary.entry(i))TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression Util.int32Value(ary.entry(i)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (int)Util.uint32Value(ary.entry(i)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    array[i] = (int)Util.uint32Value(ary.entry(i));
    4
    io.put(offset, array, 0, array.length);
    4
    io.put(offset, array, 0, array.length);
    Precondition Violations (2)
    Row Violation
    1Expression Util.int32Value(ary.entry(i)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression (int)Util.uint32Value(ary.entry(i)) cannot be parameterized, because it has dependencies to/from statements that will be extracted