Operand array = build(node.getValue(), s); Variable ret = s.getNewVariable(); s.addInstr(new JRUBY_IMPL_CALL_Instr(ret, MethAddr.TO_ARY, new Operand[]{array})); return ret;
Operand block = setupCallClosure(zsuperNode.getIterNode(), s); Variable ret = s.getNewVariable(); s.addInstr(new RUBY_INTERNALS_CALL_Instr(ret, MethAddr.SUPER, ((IR_Method)s).getCallArgs(), block)); return ret;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/compiler/ir/IR_Builder.java File path: /jruby-1.4.0/src/org/jruby/compiler/ir/IR_Builder.java
Method name: Operand buildToAry(ToAryNode, IR_Scope) Method name: Operand buildZSuper(ZSuperNode, IR_Scope)
Number of AST nodes: 4 Number of AST nodes: 4
1
Operand  array = build(node.getValue(), s);
1
Operand    block = setupCallClosure(zsuperNode.getIterNode(), s);
2
        Variable ret   = s.getNewVariable();
2
        Variable   ret   = s.getNewVariable();
3
        s.addInstr(new JRUBY_IMPL_CALL_Instr(ret, MethAddr.TO_ARY, new Operand[]{array}));
3
        s.addInstr(new RUBY_INTERNALS_CALL_Instr(ret, MethAddr.SUPER, ((IR_Method)s).getCallArgs(), block));
4
        return  ret;
4
        return ret;
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 declared in the same class
Number of node comparisons16
  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)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Operand array = build(node.getValue(), s);
    1
    Operand array = build(node.getValue(), s);
    1
    Operand block = setupCallClosure(zsuperNode.getIterNode(), s);
    Differences
    Expression1Expression2Difference
    arrayblockVARIABLE_NAME_MISMATCH
    buildsetupCallClosureMETHOD_INVOCATION_NAME_MISMATCH
    getValuegetIterNodeMETHOD_INVOCATION_NAME_MISMATCH
    nodezsuperNodeVARIABLE_NAME_MISMATCH
    org.jruby.ast.ToAryNodeorg.jruby.ast.ZSuperNodeSUBCLASS_TYPE_MISMATCH
    1
    Operand block = setupCallClosure(zsuperNode.getIterNode(), s);
    2
    Variable ret = s.getNewVariable();
    2
    Variable ret = s.getNewVariable();
    3
    s.addInstr(new JRUBY_IMPL_CALL_Instr(ret, MethAddr.TO_ARY, new Operand[] {array}));
    3
    s.addInstr(new JRUBY_IMPL_CALL_Instr(ret, MethAddr.TO_ARY, new Operand[] {array}));
    3
    s.addInstr(new RUBY_INTERNALS_CALL_Instr(ret, MethAddr.SUPER, ((IR_Method)s).getCallArgs(), block));
    Differences
    Expression1Expression2Difference
    org.jruby.compiler.ir.instructions.JRUBY_IMPL_CALL_Instrorg.jruby.compiler.ir.instructions.RUBY_INTERNALS_CALL_InstrSUBCLASS_TYPE_MISMATCH
    new JRUBY_IMPL_CALL_Instr(ret,MethAddr.TO_ARY,new Operand[]{array})new RUBY_INTERNALS_CALL_Instr(ret,MethAddr.SUPER,((IR_Method)s).getCallArgs(),block)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression new JRUBY_IMPL_CALL_Instr(ret,MethAddr.TO_ARY,new Operand[]{array}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new RUBY_INTERNALS_CALL_Instr(ret,MethAddr.SUPER,((IR_Method)s).getCallArgs(),block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new JRUBY_IMPL_CALL_Instr(ret,MethAddr.TO_ARY,new Operand[]{array}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new RUBY_INTERNALS_CALL_Instr(ret,MethAddr.SUPER,((IR_Method)s).getCallArgs(),block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    s.addInstr(new RUBY_INTERNALS_CALL_Instr(ret, MethAddr.SUPER, ((IR_Method)s).getCallArgs(), block));
    4
    return ret;
    4
    return ret;
    Precondition Violations (4)
    Row Violation
    1Expression new JRUBY_IMPL_CALL_Instr(ret,MethAddr.TO_ARY,new Operand[]{array}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new RUBY_INTERNALS_CALL_Instr(ret,MethAddr.SUPER,((IR_Method)s).getCallArgs(),block) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression new JRUBY_IMPL_CALL_Instr(ret,MethAddr.TO_ARY,new Operand[]{array}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression new RUBY_INTERNALS_CALL_Instr(ret,MethAddr.SUPER,((IR_Method)s).getCallArgs(),block) cannot be parameterized, because it has dependencies to/from statements that will be extracted