if (moduleNode.getBodyNode() != null) { compile(moduleNode.getBodyNode(), context,true); } context.loadNil();
if (iterNode.getVarNode() != null) { compileAssignment(iterNode.getVarNode(), context, 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/ASTCompiler.java
Method name: void call(BodyCompiler) Method name: void call(BodyCompiler)
Number of AST nodes: 3 Number of AST nodes: 2
1
if (moduleNode.getBodyNode() != null) {
1
if (iterNode.getVarNode() != null) {
2
                            compile(moduleNode.getBodyNode(), context,true);
2
                            compileAssignment(iterNode.getVarNode(), context, false);
3
                        }
3
                        }
4
                        context.loadNil();
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 the same java file
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)93.8
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (moduleNode.getBodyNode() != null)
    1
    if (moduleNode.getBodyNode() != null)
    1
    if (iterNode.getVarNode() != null)
    Differences
    Expression1Expression2Difference
    getBodyNodegetVarNodeMETHOD_INVOCATION_NAME_MISMATCH
    moduleNodeiterNodeVARIABLE_NAME_MISMATCH
    org.jruby.ast.ModuleNodeorg.jruby.ast.IterNodeSUBCLASS_TYPE_MISMATCH
    compilecompileAssignmentMETHOD_INVOCATION_NAME_MISMATCH
    getBodyNodegetVarNodeMETHOD_INVOCATION_NAME_MISMATCH
    moduleNodeiterNodeVARIABLE_NAME_MISMATCH
    org.jruby.ast.ModuleNodeorg.jruby.ast.IterNodeSUBCLASS_TYPE_MISMATCH
    truefalseLITERAL_VALUE_MISMATCH
    Preondition Violations
    Expression compile(moduleNode.getBodyNode(),context,true) is a void method call, and thus it cannot be parameterized
    Expression compileAssignment(iterNode.getVarNode(),context,false) is a void method call, and thus it cannot be parameterized
    1
    if (iterNode.getVarNode() != null)
    2
    compile(moduleNode.getBodyNode(), context, true);
    2
    compile(moduleNode.getBodyNode(), context, true);
    2
    compileAssignment(iterNode.getVarNode(), context, false);
    Differences
    Expression1Expression2Difference
    compilecompileAssignmentMETHOD_INVOCATION_NAME_MISMATCH
    getBodyNodegetVarNodeMETHOD_INVOCATION_NAME_MISMATCH
    moduleNodeiterNodeVARIABLE_NAME_MISMATCH
    org.jruby.ast.ModuleNodeorg.jruby.ast.IterNodeSUBCLASS_TYPE_MISMATCH
    truefalseLITERAL_VALUE_MISMATCH
    Preondition Violations
    Expression compile(moduleNode.getBodyNode(),context,true) is a void method call, and thus it cannot be parameterized
    Expression compileAssignment(iterNode.getVarNode(),context,false) is a void method call, and thus it cannot be parameterized
    2
    compileAssignment(iterNode.getVarNode(), context, false);
    3
    context.loadNil();
    3
    context.loadNil();
    Preondition Violations
    Unmatched statement context.loadNil(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                              
    Precondition Violations (5)
    Row Violation
    1Expression compile(moduleNode.getBodyNode(),context,true) is a void method call, and thus it cannot be parameterized
    2Expression compileAssignment(iterNode.getVarNode(),context,false) is a void method call, and thus it cannot be parameterized
    3Expression compile(moduleNode.getBodyNode(),context,true) is a void method call, and thus it cannot be parameterized
    4Expression compileAssignment(iterNode.getVarNode(),context,false) is a void method call, and thus it cannot be parameterized
    5Unmatched statement context.loadNil(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted