assertGetValueTwoDepthZeroOrNil(); // &foo are not getting set from somewhere...I want the following assert to be true though //assert variableValues[offset] != null : "Getting unassigned: " + staticScope.getVariables()[offset]; IRubyObject value = variableValues[2]; if (value == null) { return setValueTwoDepthZero(value); } return value;
assertGetValueThreeDepthZeroOrNil(); // &foo are not getting set from somewhere...I want the following assert to be true though //assert variableValues[offset] != null : "Getting unassigned: " + staticScope.getVariables()[offset]; IRubyObject value = variableValues[3]; if (value == null) { return setValueThreeDepthZero(value); } return value;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/runtime/scope/ManyVarsDynamicScope.java File path: /jruby-1.4.0/src/org/jruby/runtime/scope/ManyVarsDynamicScope.java
Method name: IRubyObject getValueTwoDepthZeroOrNil(IRubyObject) Method name: IRubyObject getValueThreeDepthZeroOrNil(IRubyObject)
Number of AST nodes: 5 Number of AST nodes: 5
1
assertGetValueTwoDepthZeroOrNil();
1
assertGetValueThreeDepthZeroOrNil();
2
        // &foo are not getting set from somewhere...I want the following assert to be true though
2
        // &foo are not getting set from somewhere...I want the following assert to be true though
3
        //assert variableValues[offset] != null : "Getting unassigned: " + staticScope.getVariables()[offset];
3
        //assert variableValues[offset] != null : "Getting unassigned: " + staticScope.getVariables()[offset];
4
        IRubyObject value = variableValues[2];
4
        IRubyObject value = variableValues[3];
5
        if (value == null) {
5
        if (value == null) {
6
            return setValueTwoDepthZero(value);
6
            return setValueThreeDepthZero(value);
7
        }
7
        }
8
        return value;
8
        return value;
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.1
Clones locationClones are declared in the same class
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    assertGetValueTwoDepthZeroOrNil();
    1
    assertGetValueTwoDepthZeroOrNil();
    1
    assertGetValueThreeDepthZeroOrNil();
    Differences
    Expression1Expression2Difference
    assertGetValueTwoDepthZeroOrNilassertGetValueThreeDepthZeroOrNilMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression assertGetValueTwoDepthZeroOrNil() is a void method call, and thus it cannot be parameterized
    Expression assertGetValueThreeDepthZeroOrNil() is a void method call, and thus it cannot be parameterized
    1
    assertGetValueThreeDepthZeroOrNil();
    2
    IRubyObject value = variableValues[2];
    2
    IRubyObject value = variableValues[2];
    2
    IRubyObject value = variableValues[3];
    Differences
    Expression1Expression2Difference
    23LITERAL_VALUE_MISMATCH
    2
    IRubyObject value = variableValues[3];
    3
    if (value == null)
    3
    if (value == null)
    4
    return setValueTwoDepthZero(value);
    4
    return setValueTwoDepthZero(value);
    4
    return setValueThreeDepthZero(value);
    Differences
    Expression1Expression2Difference
    setValueTwoDepthZerosetValueThreeDepthZeroMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression setValueTwoDepthZero(value) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression setValueThreeDepthZero(value) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    return setValueThreeDepthZero(value);
    5
    return value;
    5
    return value;
    Precondition Violations (4)
    Row Violation
    1Expression assertGetValueTwoDepthZeroOrNil() is a void method call, and thus it cannot be parameterized
    2Expression assertGetValueThreeDepthZeroOrNil() is a void method call, and thus it cannot be parameterized
    3Expression setValueTwoDepthZero(value) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression setValueThreeDepthZero(value) cannot be parameterized, because it has dependencies to/from statements that will be extracted