SplatNode splatNode = (SplatNode) node; compile(splatNode.getValue(), context, true); context.splatCurrentValue(); // TODO: don't require pop if (!expr) context.consumeCurrentValue();
ToAryNode toAryNode = (ToAryNode) node; compile(toAryNode.getValue(), context,true); context.aryToAry(); // TODO: don't require pop if (!expr) context.consumeCurrentValue();
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/compiler/ASTCompiler.java File path: /jruby-1.4.0/src/org/jruby/compiler/ASTCompiler.java
Method name: void compileSplat(Node, BodyCompiler, boolean) Method name: void compileToAry(Node, BodyCompiler, boolean)
Number of AST nodes: 5 Number of AST nodes: 5
1
SplatNode splatNode = (SplatNode) node;
1
ToAryNode toAryNode = (ToAryNode) node;
2
        compile(splatNode.getValue(), context, true);
2
        compile(toAryNode.getValue(), context,true);
3
        context.splatCurrentValue();
3
        context.aryToAry();
4
        // TODO: don't require pop
4
        // TODO: don't require pop
5
        if (!expr) context.consumeCurrentValue();
5
        if (!expr) context.consumeCurrentValue();
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 declared in the same class
Number of node comparisons13
  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)6.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    SplatNode splatNode = (SplatNode)node;
    1
    SplatNode splatNode = (SplatNode)node;
    1
    ToAryNode toAryNode = (ToAryNode)node;
    Differences
    Expression1Expression2Difference
    org.jruby.ast.SplatNodeorg.jruby.ast.ToAryNodeSUBCLASS_TYPE_MISMATCH
    splatNodetoAryNodeVARIABLE_NAME_MISMATCH
    org.jruby.ast.SplatNodeorg.jruby.ast.ToAryNodeSUBCLASS_TYPE_MISMATCH
    org.jruby.ast.SplatNodeorg.jruby.ast.ToAryNodeSUBCLASS_TYPE_MISMATCH
    1
    ToAryNode toAryNode = (ToAryNode)node;
    2
    compile(splatNode.getValue(), context, true);
    2
    compile(splatNode.getValue(), context, true);
    2
    compile(toAryNode.getValue(), context, true);
    Differences
    Expression1Expression2Difference
    splatNodetoAryNodeVARIABLE_NAME_MISMATCH
    org.jruby.ast.SplatNodeorg.jruby.ast.ToAryNodeSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression splatNode cannot be unified with expression toAryNode , because common superclass org.jruby.ast.Node does not declare member(s) public org.jruby.ast.Node getValue()
    2
    compile(toAryNode.getValue(), context, true);
    3
    context.splatCurrentValue();
    3
    context.splatCurrentValue();
    3
    context.aryToAry();
    Differences
    Expression1Expression2Difference
    splatCurrentValuearyToAryMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression context.splatCurrentValue() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression context.aryToAry() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression context.splatCurrentValue() is a void method call, and thus it cannot be parameterized
    Expression context.aryToAry() is a void method call, and thus it cannot be parameterized
    3
    context.aryToAry();
    4
    if (!expr)
    4
    if (!expr)
    5
    context.consumeCurrentValue();
    5
    context.consumeCurrentValue();
    Precondition Violations (5)
    Row Violation
    1Expression splatNode cannot be unified with expression toAryNode , because common superclass org.jruby.ast.Node does not declare member(s) public org.jruby.ast.Node getValue()
    2Expression context.splatCurrentValue() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression context.aryToAry() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression context.splatCurrentValue() is a void method call, and thus it cannot be parameterized
    5Expression context.aryToAry() is a void method call, and thus it cannot be parameterized