callEach(runtime, context, self, new BlockCallback() { public IRubyObject call(ThreadContext ctx, IRubyObject[] largs, Block blk) { checkContext(localContext, ctx, "none?"); IRubyObject larg = checkArgs(runtime, largs); if (block.yield(ctx, larg).isTrue()) throw JumpException.SPECIAL_JUMP; return runtime.getNil(); } });
callEach(runtime, context, self, new BlockCallback() { public IRubyObject call(ThreadContext ctx, IRubyObject[] largs, Block blk) { checkContext(localContext, ctx, "none?"); IRubyObject larg = checkArgs(runtime, largs); if (larg.isTrue()) throw JumpException.SPECIAL_JUMP; return runtime.getNil(); } });
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyEnumerable.java File path: /jruby-1.4.0/src/org/jruby/RubyEnumerable.java
Method name: IRubyObject none_p(ThreadContext, IRubyObject, Block) Method name: IRubyObject none_p(ThreadContext, IRubyObject, Block)
Number of AST nodes: 1 Number of AST nodes: 1
1
callEach(runtime, context, self, new BlockCallback() {
1
callEach(runtime, context, self, new BlockCallback() {
2
                    public IRubyObject call(ThreadContext ctx, IRubyObject[] largs, Block blk) {
2
                    public IRubyObject call(ThreadContext ctx, IRubyObject[] largs, Block blk) {
3
                        checkContext(localContext, ctx, "none?");
3
                        checkContext(localContext, ctx, "none?");
4
                        IRubyObject larg = checkArgs(runtime, largs);
4
                        IRubyObject larg = checkArgs(runtime, largs);
5
                        if (block.yield(ctx, larg).isTrue()) throw JumpException.SPECIAL_JUMP; 
5
                        if (larg.isTrue()) throw JumpException.SPECIAL_JUMP;
6
                        return runtime.getNil();
6
                        return runtime.getNil();
7
                        
8
                    }
7
                    }
9
                });
8
                });
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.0
Clones locationClones are in the same method
Number of node comparisons1
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    callEach(runtime, context, self, new BlockCallback() {...});
    5
    callEach(runtime, context, self, new BlockCallback() {...});
    6
    callEach(runtime, context, self, new BlockCallback() {...});
    Differences
    Expression1Expression2Difference
    block.yield(ctx,larg)largTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression block.yield(ctx,larg) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression larg cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    callEach(runtime, context, self, new BlockCallback() {...});
    Precondition Violations (2)
    Row Violation
    1Expression block.yield(ctx,larg) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression larg cannot be parameterized, because it has dependencies to/from statements that will be extracted