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();
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();
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 compileMatch3(Node, BodyCompiler, boolean)
Number of AST nodes: 6 Number of AST nodes: 6
1
ArgsPushNode argsPush = (ArgsPushNode) node;
1
Match3Node matchNode = (Match3Node) node;
2
        compile(argsPush.getFirstNode(), context,true);
2
        compile(matchNode.getReceiverNode(), context,true);
3
        compile(argsPush.getSecondNode(), context,true);
3
        compile(matchNode.getValueNode(), context,true);
4
        context.appendToArray();
4
        context.match3();
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)6.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    ArgsPushNode argsPush = (ArgsPushNode)node;
    1
    ArgsPushNode argsPush = (ArgsPushNode)node;
    1
    Match3Node matchNode = (Match3Node)node;
    Differences
    Expression1Expression2Difference
    org.jruby.ast.ArgsPushNodeorg.jruby.ast.Match3NodeSUBCLASS_TYPE_MISMATCH
    argsPushmatchNodeVARIABLE_NAME_MISMATCH
    org.jruby.ast.ArgsPushNodeorg.jruby.ast.Match3NodeSUBCLASS_TYPE_MISMATCH
    org.jruby.ast.ArgsPushNodeorg.jruby.ast.Match3NodeSUBCLASS_TYPE_MISMATCH
    1
    Match3Node matchNode = (Match3Node)node;
    2
    compile(argsPush.getFirstNode(), context, true);
    2
    compile(argsPush.getFirstNode(), context, true);
    2
    compile(matchNode.getReceiverNode(), context, true);
    Differences
    Expression1Expression2Difference
    getFirstNodegetReceiverNodeMETHOD_INVOCATION_NAME_MISMATCH
    argsPushmatchNodeVARIABLE_NAME_MISMATCH
    org.jruby.ast.ArgsPushNodeorg.jruby.ast.Match3NodeSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression argsPush.getFirstNode() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression matchNode.getReceiverNode() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    compile(matchNode.getReceiverNode(), context, true);
    3
    compile(argsPush.getSecondNode(), context, true);
    3
    compile(argsPush.getSecondNode(), context, true);
    3
    compile(matchNode.getValueNode(), context, true);
    Differences
    Expression1Expression2Difference
    getSecondNodegetValueNodeMETHOD_INVOCATION_NAME_MISMATCH
    argsPushmatchNodeVARIABLE_NAME_MISMATCH
    org.jruby.ast.ArgsPushNodeorg.jruby.ast.Match3NodeSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression argsPush.getSecondNode() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression matchNode.getValueNode() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    compile(matchNode.getValueNode(), context, true);
    4
    context.appendToArray();
    4
    context.appendToArray();
    4
    context.match3();
    Differences
    Expression1Expression2Difference
    appendToArraymatch3METHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression context.appendToArray() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression context.match3() 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.match3() is a void method call, and thus it cannot be parameterized
    4
    context.match3();
    5
    if (!expr)
    5
    if (!expr)
    6
    context.consumeCurrentValue();
    6
    context.consumeCurrentValue();
    Precondition Violations (8)
    Row Violation
    1Expression argsPush.getFirstNode() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression matchNode.getReceiverNode() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression argsPush.getSecondNode() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression matchNode.getValueNode() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression context.appendToArray() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression context.match3() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression context.appendToArray() is a void method call, and thus it cannot be parameterized
    8Expression context.match3() is a void method call, and thus it cannot be parameterized