Variable ret = m.getNewVariable(); Operand receiver = build(matchNode.getReceiverNode(), m); Operand value = build(matchNode.getValueNode(), m); m.addInstr(new JRUBY_IMPL_CALL_Instr(ret, MethAddr.MATCH3, new Operand[]{receiver, value})); return ret;
Variable ret = m.getNewVariable(); Operand receiver = build(matchNode.getReceiverNode(), m); Operand value = build(matchNode.getValueNode(), m); m.addInstr(new JRUBY_IMPL_CALL_Instr(ret, MethAddr.MATCH2, new Operand[]{receiver, value})); 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 buildMatch3(Match3Node, IR_Scope) Method name: Operand buildMatch2(Match2Node, IR_Scope)
Number of AST nodes: 5 Number of AST nodes: 5
1
Variable  ret       = m.getNewVariable();
1
Variable  ret       = m.getNewVariable();
2
        Operand   receiver  = build(matchNode.getReceiverNode(), m);
2
        Operand   receiver  = build(matchNode.getReceiverNode(), m);
3
        Operand   value     = build(matchNode.getValueNode(), m);
3
        Operand   value     = build(matchNode.getValueNode(), m);
4
        m.addInstr(new JRUBY_IMPL_CALL_Instr(ret, MethAddr.MATCH3, new Operand[]{receiver, value}));
4
        m.addInstr(new JRUBY_IMPL_CALL_Instr(ret, MethAddr.MATCH2, new Operand[]{receiver, value}));
5
        return ret;
5
        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 comparisons25
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    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
    Variable ret = m.getNewVariable();
    1
    Variable ret = m.getNewVariable();
    2
    Operand receiver = build(matchNode.getReceiverNode(), m);
    2
    Operand receiver = build(matchNode.getReceiverNode(), m);
    2
    Operand receiver = build(matchNode.getReceiverNode(), m);
    Differences
    Expression1Expression2Difference
    org.jruby.ast.Match3Nodeorg.jruby.ast.Match2NodeSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression matchNode cannot be unified with expression matchNode , because common superclass org.jruby.ast.Node does not declare member(s) public org.jruby.ast.Node getReceiverNode()
    2
    Operand receiver = build(matchNode.getReceiverNode(), m);
    3
    Operand value = build(matchNode.getValueNode(), m);
    3
    Operand value = build(matchNode.getValueNode(), m);
    3
    Operand value = build(matchNode.getValueNode(), m);
    Differences
    Expression1Expression2Difference
    org.jruby.ast.Match3Nodeorg.jruby.ast.Match2NodeSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression matchNode cannot be unified with expression matchNode , because common superclass org.jruby.ast.Node does not declare member(s) public org.jruby.ast.Node getValueNode()
    3
    Operand value = build(matchNode.getValueNode(), m);
    4
    m.addInstr(new JRUBY_IMPL_CALL_Instr(ret, MethAddr.MATCH3, new Operand[] {receiver, value}));
    4
    m.addInstr(new JRUBY_IMPL_CALL_Instr(ret, MethAddr.MATCH3, new Operand[] {receiver, value}));
    4
    m.addInstr(new JRUBY_IMPL_CALL_Instr(ret, MethAddr.MATCH2, new Operand[] {receiver, value}));
    Differences
    Expression1Expression2Difference
    MATCH3MATCH2VARIABLE_NAME_MISMATCH
    4
    m.addInstr(new JRUBY_IMPL_CALL_Instr(ret, MethAddr.MATCH2, new Operand[] {receiver, value}));
    5
    return ret;
    5
    return ret;
    Precondition Violations (2)
    Row Violation
    1Expression matchNode cannot be unified with expression matchNode , because common superclass org.jruby.ast.Node does not declare member(s) public org.jruby.ast.Node getReceiverNode()
    2Expression matchNode cannot be unified with expression matchNode , because common superclass org.jruby.ast.Node does not declare member(s) public org.jruby.ast.Node getValueNode()