ArgsFileData data = ArgsFileData.getDataFrom(recv); if (!data.inited) return context.getRuntime().getTrue(); if (!(data.currentFile instanceof RubyIO)) return data.currentFile.callMethod(context, "eof?"); return ((RubyIO) data.currentFile).eof_p(context);
ArgsFileData data = ArgsFileData.getDataFrom(recv); if(!data.inited) return context.getRuntime().getTrue(); if(!(data.currentFile instanceof RubyIO)) return data.currentFile.callMethod(context, "eof"); return ((RubyIO) data.currentFile).eof_p(context);
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyArgsFile.java File path: /jruby-1.4.0/src/org/jruby/RubyArgsFile.java
Method name: IRubyObject eof_p(ThreadContext, IRubyObject) Method name: IRubyObject eof(ThreadContext, IRubyObject)
Number of AST nodes: 6 Number of AST nodes: 6
1
ArgsFileData data = ArgsFileData.getDataFrom(recv);
1
ArgsFileData data = ArgsFileData.getDataFrom(recv);
2
        if (!data.inited) return context.getRuntime().getTrue();
2
        if(!data.inited) return context.getRuntime().getTrue();
3
        if (!(data.currentFile instanceof RubyIO)) return data.currentFile.callMethod(context, "eof?");
3
        if(!(data.currentFile instanceof RubyIO)) return data.currentFile.callMethod(context, "eof");
4
        return ((RubyIO) data.currentFile).eof_p(context);
4
        return ((RubyIO) data.currentFile).eof_p(context);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are declared in the same class
Number of node comparisons17
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements6
    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
    ArgsFileData data = ArgsFileData.getDataFrom(recv);
    1
    ArgsFileData data = ArgsFileData.getDataFrom(recv);
    2
    if (!data.inited)
    2
    if (!data.inited)
    3
    return context.getRuntime().getTrue();
    3
    return context.getRuntime().getTrue();
    4
    if (!(data.currentFile instanceof RubyIO))
    4
    if (!(data.currentFile instanceof RubyIO))
    5
    return data.currentFile.callMethod(context, "eof?");
    5
    return data.currentFile.callMethod(context, "eof?");
    5
    return data.currentFile.callMethod(context, "eof");
    Differences
    Expression1Expression2Difference
    "eof?""eof"LITERAL_VALUE_MISMATCH
    5
    return data.currentFile.callMethod(context, "eof");
    6
    return ((RubyIO)data.currentFile).eof_p(context);
    6
    return ((RubyIO)data.currentFile).eof_p(context);
    Precondition Violations (0)
    Row Violation