Label falseJmp = new Label();
// dup it since we need to return appropriately if it's false
method.dup();
// call isTrue on the result
isTrue();
method.ifne(falseJmp); // EQ == 0 (i.e. false)
// pop the extra result and replace with the send part of the AND
method.pop();
longBranch.branch(this);
method.label(falseJmp);
Label falseJmp = new Label();
// dup it since we need to return appropriately if it's false
method.dup();
// call isTrue on the result
isTrue();
method.ifeq(falseJmp); // EQ == 0 (i.e. false)
// pop the extra result and replace with the send part of the AND
method.pop();
longBranch.branch(this);
method.label(falseJmp);
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/compiler/impl/BaseBodyCompiler.java
|
|
File path: /jruby-1.4.0/src/org/jruby/compiler/impl/BaseBodyCompiler.java
|
Method name: void performLogicalOr(BranchCallback)
|
|
Method name: void performLogicalAnd(BranchCallback)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | Label falseJmp = new Label();↵ | | 1 | Label falseJmp = new Label();↵
|
|
2 | // dup it since we need to return appropriately if it's false↵ | | 2 | // dup it since we need to return appropriately if it's false↵
|
3 | method.dup();↵ | | 3 | method.dup();↵
|
|
4 | // call isTrue on the result↵ | | 4 | // call isTrue on the result↵
|
5 | isTrue();↵ | | 5 | isTrue();↵
|
|
6 | method.ifne(falseJmp); // EQ == 0 (i.e. false)↵ | | 6 | method.ifeq(falseJmp); // EQ == 0 (i.e. false)↵
|
7 | // pop the extra result and replace with the send part of the AND↵ | | 7 | // pop the extra result and replace with the send part of the AND↵
|
8 | method.pop();↵ | | 8 | method.pop();↵
|
9 | longBranch.branch(this);↵ | | 9 | longBranch.branch(this);↵
|
10 | method.label(falseJmp); | | 10 | method.label(falseJmp);
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 37 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | Label falseJmp = new Label(); | | 1 | Label falseJmp = new Label(); |
2 | method.dup(); | | 2 | method.dup(); |
3 | isTrue(); | | 3 | isTrue(); |
4 | method.ifne(falseJmp); | | 4 | method.ifeq(falseJmp); |
5 | method.pop(); | | 5 | method.pop(); |
6 | longBranch.branch(this); | | 6 | longBranch.branch(this); |
7 | method.label(falseJmp); | | 7 | method.label(falseJmp); |
Precondition Violations (4)
Row |
Violation |
1 | Expression method.ifne(falseJmp) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression method.ifeq(falseJmp) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression method.ifne(falseJmp) is a void method call, and thus it cannot be parameterized |
4 | Expression method.ifeq(falseJmp) is a void method call, and thus it cannot be parameterized |