if (yieldNode.getArgsNode() != null) { argsCallback2 = new CompilerCallback() { public void call(BodyCompiler context) { compile(yieldNode.getArgsNode(), context,true); } }; }
if (argsNode.getBlock() != null) { blockAssignment = new CompilerCallback() { public void call(BodyCompiler context) { context.getVariableCompiler().assignLocalVariable(argsNode.getBlock().getCount(), false); } }; }
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/ASTCompiler19.java
Method name: void compileYield(Node, BodyCompiler, boolean) Method name: void compileMethodArgs(Node, BodyCompiler, boolean)
Number of AST nodes: 2 Number of AST nodes: 2
1
if (yieldNode.getArgsNode() != null) {
1
if (argsNode.getBlock() != null) {
2
                argsCallback2 = new CompilerCallback() {
2
            blockAssignment = new CompilerCallback() {
3
                    public void call(BodyCompiler context) {
3
                public void call(BodyCompiler context) {
4
                        compile(yieldNode.getArgsNode(), context,true);
4
                    
5
    
5
context.getVariableCompiler().assignLocalVariable(argsNode.getBlock().getCount(), false);
6
                }
6
                }
7
                };
7
            
8
    
8
};
9
        }
9
        }
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.3
Clones locationClones are in different classes having the same super class
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)14.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    8
    if (yieldNode.getArgsNode() != null)
    8
    if (yieldNode.getArgsNode() != null)
    17
    if (argsNode.getBlock() != null)
    Differences
    Expression1Expression2Difference
    getArgsNodegetBlockMETHOD_INVOCATION_NAME_MISMATCH
    yieldNodeargsNodeVARIABLE_NAME_MISMATCH
    org.jruby.ast.YieldNodeorg.jruby.ast.ArgsNodeSUBCLASS_TYPE_MISMATCH
    17
    if (argsNode.getBlock() != null)
    9
    argsCallback2 = new CompilerCallback() {...};
    9
    argsCallback2 = new CompilerCallback() {...};
    18
    blockAssignment = new CompilerCallback() {...};
    Differences
    Expression1Expression2Difference
    argsCallback2blockAssignmentVARIABLE_NAME_MISMATCH
    compileassignLocalVariableMETHOD_INVOCATION_NAME_MISMATCH
    compile(yieldNode.getArgsNode(),context,true)context.getVariableCompiler().assignLocalVariable(argsNode.getBlock().getCount(),false)ARGUMENT_NUMBER_MISMATCH
    context.getVariableCompiler()MISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression compile(yieldNode.getArgsNode(),context,true) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression compile(yieldNode.getArgsNode(),context,true) is a void method call, and thus it cannot be parameterized
    Expression context.getVariableCompiler().assignLocalVariable(argsNode.getBlock().getCount(),false) is a void method call, and thus it cannot be parameterized
    Expression compile(yieldNode.getArgsNode(),context,true) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression compile(yieldNode.getArgsNode(),context,true) is a void method call, and thus it cannot be parameterized
    Expression context.getVariableCompiler().assignLocalVariable(argsNode.getBlock().getCount(),false) is a void method call, and thus it cannot be parameterized
    18
    blockAssignment = new CompilerCallback() {...};
    Precondition Violations (6)
    Row Violation
    1Expression compile(yieldNode.getArgsNode(),context,true) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression compile(yieldNode.getArgsNode(),context,true) is a void method call, and thus it cannot be parameterized
    3Expression context.getVariableCompiler().assignLocalVariable(argsNode.getBlock().getCount(),false) is a void method call, and thus it cannot be parameterized
    4Expression compile(yieldNode.getArgsNode(),context,true) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression compile(yieldNode.getArgsNode(),context,true) is a void method call, and thus it cannot be parameterized
    6Expression context.getVariableCompiler().assignLocalVariable(argsNode.getBlock().getCount(),false) is a void method call, and thus it cannot be parameterized