List<Operand> strPieces = new ArrayList<Operand>();
for (Node n : dstrNode.childNodes())
strPieces.add(build(n, s));
return new CompoundString(strPieces);
List<Operand> strPieces = new ArrayList<Operand>();
for (Node n : node.childNodes())
strPieces.add(build(n, s));
return new DynamicSymbol(new CompoundString(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 buildDStr(DStrNode, IR_Scope)
|
|
Method name: Operand buildDSymbol(Node, 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 : dstrNode.childNodes())↵ | | 2 | for (Node n : node.childNodes())↵
|
3 | strPieces.add(build(n, s));↵ | | 3 | strPieces.add(build(n, s));↵
|
|
4 | return new CompoundString(strPieces); | | 4 | return new DynamicSymbol(new CompoundString(strPieces));
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 8 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 46.2 |
Clone type | Type 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 : dstrNode.childNodes()) | | 2 | for (Node n : node.childNodes()) |
3 | strPieces.add(build(n, s)); | | 3 | strPieces.add(build(n, s)); |
| | | 4 | return new DynamicSymbol(new CompoundString(strPieces)); |
4 | return new CompoundString(strPieces); | | | |
Precondition Violations (0)
Row |
Violation |