if (newValue.isNil()) { runtime.setVerbose(newValue); } else { runtime.setVerbose(runtime.newBoolean(newValue.isTrue())); } return newValue;
if (newValue.isNil()) { runtime.setDebug(newValue); } else { runtime.setDebug(runtime.newBoolean(newValue.isTrue())); } return newValue;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyGlobal.java File path: /jruby-1.4.0/src/org/jruby/RubyGlobal.java
Method name: IRubyObject set(IRubyObject) Method name: IRubyObject set(IRubyObject)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (newValue.isNil()) {
1
if (newValue.isNil()) {
2
                runtime.setVerbose(newValue);
2
                runtime.setDebug(newValue);
3
            } else {
3
            } else {
4
                runtime.setVerbose(runtime.newBoolean(newValue.isTrue()));
4
                runtime.setDebug(runtime.newBoolean(newValue.isTrue()));
5
            }
5
            }
6
            return newValue;
6
            return newValue;
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 in the same java file
Number of node comparisons10
  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.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (newValue.isNil())
    1
    if (newValue.isNil())
    2
    runtime.setVerbose(newValue);
    2
    runtime.setVerbose(newValue);
    2
    runtime.setDebug(newValue);
    Differences
    Expression1Expression2Difference
    setVerbosesetDebugMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression runtime.setVerbose(newValue) is a void method call, and thus it cannot be parameterized
    Expression runtime.setDebug(newValue) is a void method call, and thus it cannot be parameterized
    2
    runtime.setDebug(newValue);
    else
    else
    3
    runtime.setVerbose(runtime.newBoolean(newValue.isTrue()));
    3
    runtime.setVerbose(runtime.newBoolean(newValue.isTrue()));
    3
    runtime.setDebug(runtime.newBoolean(newValue.isTrue()));
    Differences
    Expression1Expression2Difference
    setVerbosesetDebugMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression runtime.setVerbose(runtime.newBoolean(newValue.isTrue())) is a void method call, and thus it cannot be parameterized
    Expression runtime.setDebug(runtime.newBoolean(newValue.isTrue())) is a void method call, and thus it cannot be parameterized
    3
    runtime.setDebug(runtime.newBoolean(newValue.isTrue()));
    4
    return newValue;
    4
    return newValue;
    Precondition Violations (4)
    Row Violation
    1Expression runtime.setVerbose(newValue) is a void method call, and thus it cannot be parameterized
    2Expression runtime.setDebug(newValue) is a void method call, and thus it cannot be parameterized
    3Expression runtime.setVerbose(runtime.newBoolean(newValue.isTrue())) is a void method call, and thus it cannot be parameterized
    4Expression runtime.setDebug(runtime.newBoolean(newValue.isTrue())) is a void method call, and thus it cannot be parameterized