ArgsPushNode argsPush = (ArgsPushNode) node; compile(argsPush.getFirstNode(), context,true); compile(argsPush.getSecondNode(), context,true); context.appendToArray(); // TODO: don't require pop if (!expr) context.consumeCurrentValue();
SplatNode splatNode = (SplatNode) node; compile(splatNode.getValue(), context,true); context.splatCurrentValue(); context.convertToJavaArray(); // 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/ASTCompiler19.java File path: /jruby-1.4.0/src/org/jruby/compiler/ASTCompiler.java
Method name: void compileArgsPush(Node, BodyCompiler, boolean) Method name: void compileSplatArguments(Node, BodyCompiler, boolean)
Number of AST nodes: 6 Number of AST nodes: 6
1
ArgsPushNode argsPush = (ArgsPushNode) node;
1
SplatNode splatNode = (SplatNode) node;
2
        compile(argsPush.getFirstNode(), context,true);
2
        compile(splatNode.getValue(), context,true);
3
        compile(argsPush.getSecondNode(), context,true);
3
        context.splatCurrentValue();
4
        context.appendToArray();
4
        context.convertToJavaArray();
5
        // TODO: don't require pop
5
        // TODO: don't require pop
6
        if (!expr) context.consumeCurrentValue();
6
        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 in different classes having the same super class
Number of node comparisons20
  1. {Non-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)97.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    ArgsPushNode argsPush = (ArgsPushNode)node;
    1
    ArgsPushNode argsPush = (ArgsPushNode)node;
    1
    SplatNode splatNode = (SplatNode)node;
    Differences
    Expression1Expression2Difference
    org.jruby.ast.ArgsPushNodeorg.jruby.ast.SplatNodeSUBCLASS_TYPE_MISMATCH
    argsPushsplatNodeVARIABLE_NAME_MISMATCH
    org.jruby.ast.ArgsPushNodeorg.jruby.ast.SplatNodeSUBCLASS_TYPE_MISMATCH
    org.jruby.ast.ArgsPushNodeorg.jruby.ast.SplatNodeSUBCLASS_TYPE_MISMATCH
    1
    SplatNode splatNode = (SplatNode)node;
    2
    compile(argsPush.getFirstNode(), context, true);
    2
    compile(argsPush.getFirstNode(), context, true);
    3
    context.splatCurrentValue();
    Differences
    Expression1Expression2Difference
    compilesplatCurrentValueMETHOD_INVOCATION_NAME_MISMATCH
    compile(argsPush.getFirstNode(),context,true)context.splatCurrentValue()ARGUMENT_NUMBER_MISMATCH
    contextMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression compile(argsPush.getFirstNode(),context,true) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression context.splatCurrentValue() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression compile(argsPush.getFirstNode(),context,true) is a void method call, and thus it cannot be parameterized
    Expression context.splatCurrentValue() is a void method call, and thus it cannot be parameterized
    Expression compile(argsPush.getFirstNode(),context,true) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression context.splatCurrentValue() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression compile(argsPush.getFirstNode(),context,true) is a void method call, and thus it cannot be parameterized
    Expression context.splatCurrentValue() is a void method call, and thus it cannot be parameterized
    3
    context.splatCurrentValue();
    3
    compile(argsPush.getSecondNode(), context, true);
    3
    compile(argsPush.getSecondNode(), context, true);
    2
    compile(splatNode.getValue(), context, true);
    Differences
    Expression1Expression2Difference
    getSecondNodegetValueMETHOD_INVOCATION_NAME_MISMATCH
    argsPushsplatNodeVARIABLE_NAME_MISMATCH
    org.jruby.ast.ArgsPushNodeorg.jruby.ast.SplatNodeSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression argsPush.getSecondNode() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression splatNode.getValue() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    compile(splatNode.getValue(), context, true);
    4
    context.appendToArray();
    4
    context.appendToArray();
    4
    context.convertToJavaArray();
    Differences
    Expression1Expression2Difference
    appendToArrayconvertToJavaArrayMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression context.appendToArray() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression context.convertToJavaArray() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression context.appendToArray() is a void method call, and thus it cannot be parameterized
    Expression context.convertToJavaArray() is a void method call, and thus it cannot be parameterized
    4
    context.convertToJavaArray();
    5
    if (!expr)
    5
    if (!expr)
    6
    context.consumeCurrentValue();
    6
    context.consumeCurrentValue();
    Precondition Violations (14)
    Row Violation
    1Expression compile(argsPush.getFirstNode(),context,true) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression context.splatCurrentValue() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression compile(argsPush.getFirstNode(),context,true) is a void method call, and thus it cannot be parameterized
    4Expression context.splatCurrentValue() is a void method call, and thus it cannot be parameterized
    5Expression compile(argsPush.getFirstNode(),context,true) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression context.splatCurrentValue() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression compile(argsPush.getFirstNode(),context,true) is a void method call, and thus it cannot be parameterized
    8Expression context.splatCurrentValue() is a void method call, and thus it cannot be parameterized
    9Expression argsPush.getSecondNode() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression splatNode.getValue() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression context.appendToArray() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression context.convertToJavaArray() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression context.appendToArray() is a void method call, and thus it cannot be parameterized
    14Expression context.convertToJavaArray() is a void method call, and thus it cannot be parameterized