IRubyObject line = gets(context, args); if (line.isNil()) throw getRuntime().newEOFError(); return line;
IRubyObject line = gets(context, separator); if (line.isNil()) throw context.getRuntime().newEOFError(); return line;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyStringIO.java File path: /jruby-1.4.0/src/org/jruby/RubyIO.java
Method name: IRubyObject readline(ThreadContext, IRubyObject[]) Method name: IRubyObject readline(ThreadContext, IRubyObject)
Number of AST nodes: 4 Number of AST nodes: 4
1
IRubyObject line = gets(context, args);
1
IRubyObject line = gets(context, separator);
2
        if (line.isNil()) throw getRuntime().newEOFError();
2
        if (line.isNil()) throw context.getRuntime().newEOFError();
3
        
4
        return line;
3
        return line;
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 in different classes having the same super 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.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    IRubyObject line = gets(context, args);
    1
    IRubyObject line = gets(context, args);
    1
    IRubyObject line = gets(context, separator);
    Differences
    Expression1Expression2Difference
    argsseparatorVARIABLE_NAME_MISMATCH
    org.jruby.runtime.builtin.IRubyObject[]org.jruby.runtime.builtin.IRubyObjectVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jruby.runtime.builtin.IRubyObject[] of variable args does not match with type org.jruby.runtime.builtin.IRubyObject of variable separator
    • Make classes org.jruby.runtime.builtin.IRubyObject[] and org.jruby.runtime.builtin.IRubyObject extend a common superclass
    1
    IRubyObject line = gets(context, separator);
    2
    if (line.isNil())
    2
    if (line.isNil())
    3
    throw getRuntime().newEOFError();
    3
    throw getRuntime().newEOFError();
    3
    throw context.getRuntime().newEOFError();
    Differences
    Expression1Expression2Difference
    contextMISSING_METHOD_INVOCATION_EXPRESSION
    3
    throw context.getRuntime().newEOFError();
    4
    return line;
    4
    return line;
    Precondition Violations (1)
    Row Violation
    1Type org.jruby.runtime.builtin.IRubyObject[] of variable args does not match with type org.jruby.runtime.builtin.IRubyObject of variable separator