Match3Node matchNode = (Match3Node) node; compile(matchNode.getReceiverNode(), context,true); compile(matchNode.getValueNode(), context,true); context.match3(); // 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/ASTCompiler.java File path: /jruby-1.4.0/src/org/jruby/compiler/ASTCompiler.java
Method name: void compileMatch3(Node, BodyCompiler, boolean) Method name: void compileSplatArguments(Node, BodyCompiler, boolean)
Number of AST nodes: 6 Number of AST nodes: 6
1
Match3Node matchNode = (Match3Node) node;
1
SplatNode splatNode = (SplatNode) node;
2
        compile(matchNode.getReceiverNode(), context,true);
2
        compile(splatNode.getValue(), context,true);
3
        compile(matchNode.getValueNode(), context,true);
3
        co
4
        context.match3
4
ntext.splatCurrentValue();
5
();
5
        context.convertToJavaArray();
6
        // TODO: don't require pop
6
        // TODO: don't require pop
7
        if (!expr) context.consumeCurrentValue();
7
        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 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)95.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Match3Node matchNode = (Match3Node)node;
    1
    Match3Node matchNode = (Match3Node)node;
    1
    SplatNode splatNode = (SplatNode)node;
    Differences
    Expression1Expression2Difference
    org.jruby.ast.Match3Nodeorg.jruby.ast.SplatNodeSUBCLASS_TYPE_MISMATCH
    matchNodesplatNodeVARIABLE_NAME_MISMATCH
    org.jruby.ast.Match3Nodeorg.jruby.ast.SplatNodeSUBCLASS_TYPE_MISMATCH
    org.jruby.ast.Match3Nodeorg.jruby.ast.SplatNodeSUBCLASS_TYPE_MISMATCH
    1
    SplatNode splatNode = (SplatNode)node;
    2
    compile(matchNode.getReceiverNode(), context, true);
    2
    compile(matchNode.getReceiverNode(), context, true);
    3
    context.splatCurrentValue();
    Differences
    Expression1Expression2Difference
    compilesplatCurrentValueMETHOD_INVOCATION_NAME_MISMATCH
    compile(matchNode.getReceiverNode(),context,true)context.splatCurrentValue()ARGUMENT_NUMBER_MISMATCH
    contextMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression compile(matchNode.getReceiverNode(),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(matchNode.getReceiverNode(),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(matchNode.getReceiverNode(),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(matchNode.getReceiverNode(),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(matchNode.getValueNode(), context, true);
    3
    compile(matchNode.getValueNode(), context, true);
    2
    compile(splatNode.getValue(), context, true);
    Differences
    Expression1Expression2Difference
    getValueNodegetValueMETHOD_INVOCATION_NAME_MISMATCH
    matchNodesplatNodeVARIABLE_NAME_MISMATCH
    org.jruby.ast.Match3Nodeorg.jruby.ast.SplatNodeSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression matchNode.getValueNode() 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.match3();
    4
    context.match3();
    4
    context.convertToJavaArray();
    Differences
    Expression1Expression2Difference
    match3convertToJavaArrayMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression context.match3() 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.match3() 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(matchNode.getReceiverNode(),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(matchNode.getReceiverNode(),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(matchNode.getReceiverNode(),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(matchNode.getReceiverNode(),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 matchNode.getValueNode() 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.match3() 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.match3() 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