checkBounds(offset, len << 2); int begin = index(offset); for (int i = 0; i < len; ++i) { IO.putInt32(buffer, begin + (i << 2), src[off + i]); }
checkBounds(offset, len << 2); int begin = index(offset); for (int i = 0; i < len; ++i) { IO.putFloat32(buffer, begin + (i << 2), src[off + i]); }
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/ext/ffi/ArrayMemoryIO.java File path: /jruby-1.4.0/src/org/jruby/ext/ffi/ArrayMemoryIO.java
Method name: void put(long, int[], int, int) Method name: void put(long, float[], int, int)
Number of AST nodes: 4 Number of AST nodes: 4
1
checkBounds(offset, len << 2);
1
checkBounds(offset, len << 2);
2
        int begin = index(offset);
2
        int begin = index(offset);
3
        for (int i = 0; i < len; ++i) {
3
        for (int i = 0; i < len; ++i) {
4
            IO.putInt32(buffer, begin + (i << 2), src[off + i]);
4
            IO.putFloat32(buffer, begin + (i << 2), src[off + i]);
5
        }
5
        }
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.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    checkBounds(offset, len << 2);
    1
    checkBounds(offset, len << 2);
    2
    int begin = index(offset);
    2
    int begin = index(offset);
    3
    for (int i = 0; i < len; ++i)
    3
    for (int i = 0; i < len; ++i)
    4
    IO.putInt32(buffer, begin + (i << 2), src[off + i]);
    4
    IO.putInt32(buffer, begin + (i << 2), src[off + i]);
    4
    IO.putFloat32(buffer, begin + (i << 2), src[off + i]);
    Differences
    Expression1Expression2Difference
    putInt32putFloat32METHOD_INVOCATION_NAME_MISMATCH
    int[]float[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression IO.putInt32(buffer,begin + (i << 2),src[off + i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression IO.putFloat32(buffer,begin + (i << 2),src[off + i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression IO.putInt32(buffer,begin + (i << 2),src[off + i]) is a void method call, and thus it cannot be parameterized
    Expression IO.putFloat32(buffer,begin + (i << 2),src[off + i]) is a void method call, and thus it cannot be parameterized
    Type int[] of variable src does not match with type float[] of variable src
    • Make classes int[] and float[] extend a common superclass
    4
    IO.putFloat32(buffer, begin + (i << 2), src[off + i]);
    Precondition Violations (5)
    Row Violation
    1Expression IO.putInt32(buffer,begin + (i << 2),src[off + i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression IO.putFloat32(buffer,begin + (i << 2),src[off + i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression IO.putInt32(buffer,begin + (i << 2),src[off + i]) is a void method call, and thus it cannot be parameterized
    4Expression IO.putFloat32(buffer,begin + (i << 2),src[off + i]) is a void method call, and thus it cannot be parameterized
    5Type int[] of variable src does not match with type float[] of variable src