List<Operand> strPieces = new ArrayList<Operand>(); for (Node n : node.childNodes()) strPieces.add(build(n, s)); return new DynamicSymbol(new CompoundString(strPieces));
List<Operand> strPieces = new ArrayList<Operand>(); for (Node nextNode : dstrNode.childNodes()) strPieces.add(build(nextNode, m)); return new BacktickString(strPieces);
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/compiler/ir/IR_Builder.java File path: /jruby-1.4.0/src/org/jruby/compiler/ir/IR_Builder.java
Method name: Operand buildDSymbol(Node, IR_Scope) Method name: Operand buildDXStr(DXStrNode, IR_Scope)
Number of AST nodes: 4 Number of AST nodes: 4
1
List<Operand> strPieces = new ArrayList<Operand>();
1
List<Operand> strPieces = new ArrayList<Operand>();
2
        for (Node n : node.childNodes())
2
        for (Node nextNode : dstrNode.childNodes())
3
            strPieces.add(build(n, s));
3
            strPieces.add(build(nextNode, m));
4
        return new DynamicSymbol(new CompoundString(strPieces));
4
        return new BacktickString(strPieces);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are declared in the same class
Number of node comparisons8
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)48.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    List<Operand> strPieces = new ArrayList<Operand>();
    1
    List<Operand> strPieces = new ArrayList<Operand>();
    2
    for (Node n : node.childNodes())
    2
    for (Node n : node.childNodes())
    2
    for (Node nextNode : dstrNode.childNodes())
    Differences
    Expression1Expression2Difference
    nnextNodeVARIABLE_NAME_MISMATCH
    nodedstrNodeVARIABLE_NAME_MISMATCH
    org.jruby.ast.Nodeorg.jruby.ast.DXStrNodeSUBCLASS_TYPE_MISMATCH
    2
    for (Node nextNode : dstrNode.childNodes())
    3
    strPieces.add(build(n, s));
    3
    strPieces.add(build(n, s));
    3
    strPieces.add(build(nextNode, m));
    Differences
    Expression1Expression2Difference
    nnextNodeVARIABLE_NAME_MISMATCH
    smVARIABLE_NAME_MISMATCH
    3
    strPieces.add(build(nextNode, m));
                                                                                    
    4
    return new BacktickString(strPieces);
    4
    return new DynamicSymbol(new CompoundString(strPieces));
                                                                                                                          
    Precondition Violations (0)
    Row Violation