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;
assertGetValueOneDepthZeroOrNil(); // &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[1]; if (value == null) { return setValueOneDepthZero(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 getValueOneDepthZeroOrNil(IRubyObject)
Number of AST nodes: 5 Number of AST nodes: 5
1
assertGetValueZeroDepthZeroOrNil();
1
assertGetValueOneDepthZeroOrNil();
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[1];
5
        if (value == null) {
5
        if (value == null) {
6
            return setValueZeroDepthZero(value);
6
            return setValueOneDepthZero(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)1.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    assertGetValueZeroDepthZeroOrNil();
    1
    assertGetValueZeroDepthZeroOrNil();
    1
    assertGetValueOneDepthZeroOrNil();
    Differences
    Expression1Expression2Difference
    assertGetValueZeroDepthZeroOrNilassertGetValueOneDepthZeroOrNilMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression assertGetValueZeroDepthZeroOrNil() is a void method call, and thus it cannot be parameterized
    Expression assertGetValueOneDepthZeroOrNil() is a void method call, and thus it cannot be parameterized
    1
    assertGetValueOneDepthZeroOrNil();
    2
    IRubyObject value = variableValues[0];
    2
    IRubyObject value = variableValues[0];
    2
    IRubyObject value = variableValues[1];
    Differences
    Expression1Expression2Difference
    01LITERAL_VALUE_MISMATCH
    2
    IRubyObject value = variableValues[1];
    3
    if (value == null)
    3
    if (value == null)
    4
    return setValueZeroDepthZero(value);
    4
    return setValueZeroDepthZero(value);
    4
    return setValueOneDepthZero(value);
    Differences
    Expression1Expression2Difference
    setValueZeroDepthZerosetValueOneDepthZeroMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression setValueZeroDepthZero(value) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression setValueOneDepthZero(value) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    return setValueOneDepthZero(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 assertGetValueOneDepthZeroOrNil() 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 setValueOneDepthZero(value) cannot be parameterized, because it has dependencies to/from statements that will be extracted