assertGetValueZeroDepthZeroOrNil(); // &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[0]; if (value == null) { return setValueZeroDepthZero(value); } return value;
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;
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 getValueZeroDepthZeroOrNil(IRubyObject) Method name: IRubyObject getValueTwoDepthZeroOrNil(IRubyObject)
Number of AST nodes: 5 Number of AST nodes: 5
1
assertGetValueZeroDepthZeroOrNil();
1
assertGetValueTwoDepthZeroOrNil();
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[0];
4
        IRubyObject value = variableValues[2];
5
        if (value == null) {
5
        if (value == null) {
6
            return setValueZeroDepthZero(value);
6
            return setValueTwoDepthZero(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
    assertGetValueZeroDepthZeroOrNil();
    1
    assertGetValueZeroDepthZeroOrNil();
    1
    assertGetValueTwoDepthZeroOrNil();
    Differences
    Expression1Expression2Difference
    assertGetValueZeroDepthZeroOrNilassertGetValueTwoDepthZeroOrNilMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression assertGetValueZeroDepthZeroOrNil() is a void method call, and thus it cannot be parameterized
    Expression assertGetValueTwoDepthZeroOrNil() is a void method call, and thus it cannot be parameterized
    1
    assertGetValueTwoDepthZeroOrNil();
    2
    IRubyObject value = variableValues[0];
    2
    IRubyObject value = variableValues[0];
    2
    IRubyObject value = variableValues[2];
    Differences
    Expression1Expression2Difference
    02LITERAL_VALUE_MISMATCH
    2
    IRubyObject value = variableValues[2];
    3
    if (value == null)
    3
    if (value == null)
    4
    return setValueZeroDepthZero(value);
    4
    return setValueZeroDepthZero(value);
    4
    return setValueTwoDepthZero(value);
    Differences
    Expression1Expression2Difference
    setValueZeroDepthZerosetValueTwoDepthZeroMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression setValueZeroDepthZero(value) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression setValueTwoDepthZero(value) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    return setValueTwoDepthZero(value);
    5
    return value;
    5
    return value;
    Precondition Violations (4)
    Row Violation
    1Expression assertGetValueZeroDepthZeroOrNil() is a void method call, and thus it cannot be parameterized
    2Expression assertGetValueTwoDepthZeroOrNil() is a void method call, and thus it cannot be parameterized
    3Expression setValueZeroDepthZero(value) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression setValueTwoDepthZero(value) cannot be parameterized, because it has dependencies to/from statements that will be extracted