IRubyObject receiver = getReceiverNode().interpret(runtime, context, self, aBlock);
IRubyObject rArg1 = arg1.interpret(runtime, context, self, aBlock);
IRubyObject firstValue = elementAdapter.call(context, self, receiver, rArg1);
if (firstValue.isTrue()) return firstValue;
firstValue = getValueNode().interpret(runtime, context, self, aBlock);
elementAsgnAdapter.call(context, self, receiver, rArg1, firstValue);
return firstValue;
IRubyObject receiver = getReceiverNode().interpret(runtime, context, self, aBlock);
IRubyObject rArg1 = arg1.interpret(runtime, context, self, aBlock);
IRubyObject firstValue = elementAdapter.call(context, self, receiver, rArg1);
if (!firstValue.isTrue()) return firstValue;
firstValue = getValueNode().interpret(runtime, context, self, aBlock);
elementAsgnAdapter.call(context, self, receiver, rArg1, firstValue);
return firstValue;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/ast/OpElementOneArgOrAsgnNode.java
|
|
File path: /jruby-1.4.0/src/org/jruby/ast/OpElementOneArgAndAsgnNode.java
|
Method name: IRubyObject interpret(Ruby, ThreadContext, IRubyObject, Block)
|
|
Method name: IRubyObject interpret(Ruby, ThreadContext, IRubyObject, Block)
|
Number of AST nodes: 8
|
|
Number of AST nodes: 8
|
|
1 | IRubyObject receiver = getReceiverNode().interpret(runtime, context, self, aBlock);↵ | | 1 | IRubyObject receiver = getReceiverNode().interpret(runtime, context, self, aBlock);↵
|
2 | IRubyObject rArg1 = arg1.interpret(runtime, context, self, aBlock);↵ | | 2 | IRubyObject rArg1 = arg1.interpret(runtime, context, self, aBlock);↵
|
3 | IRubyObject firstValue = elementAdapter.call(context, self, receiver, rArg1);↵ | | 3 | IRubyObject firstValue = elementAdapter.call(context, self, receiver, rArg1);↵
|
4 | ↵ | | 4 | ↵
|
5 | if (firstValue.isTrue()) return firstValue;↵ | | 5 | if (!firstValue.isTrue()) return firstValue;↵
|
|
6 | firstValue = getValueNode().interpret(runtime, context, self, aBlock);↵ | | 6 | firstValue = getValueNode().interpret(runtime, context, self, aBlock);↵
|
|
7 | elementAsgnAdapter.call(context, self, receiver, rArg1, firstValue);↵ | | 7 | elementAsgnAdapter.call(context, self, receiver, rArg1, firstValue);↵
|
8 | ↵ | | 8 | ↵
|
9 | return firstValue; | | 9 | return firstValue;
|
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.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 40 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 8 |
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) | 4.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | IRubyObject receiver = getReceiverNode().interpret(runtime, context, self, aBlock); | | 1 | IRubyObject receiver = getReceiverNode().interpret(runtime, context, self, aBlock); |
2 | IRubyObject rArg1 = arg1.interpret(runtime, context, self, aBlock); | | 2 | IRubyObject rArg1 = arg1.interpret(runtime, context, self, aBlock); |
3 | IRubyObject firstValue = elementAdapter.call(context, self, receiver, rArg1); | | 3 | IRubyObject firstValue = elementAdapter.call(context, self, receiver, rArg1); |
4 | if (firstValue.isTrue()) | | 4 | if (!firstValue.isTrue()) |
5 | | | 5 | |
6 | firstValue = getValueNode().interpret(runtime, context, self, aBlock); | | 6 | firstValue = getValueNode().interpret(runtime, context, self, aBlock); |
7 | elementAsgnAdapter.call(context, self, receiver, rArg1, firstValue); | | 7 | elementAsgnAdapter.call(context, self, receiver, rArg1, firstValue); |
8 | return firstValue; | | 8 | return firstValue; |
Precondition Violations (2)
Row |
Violation |
1 | Expression firstValue.isTrue() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression !firstValue.isTrue() cannot be parameterized, because it has dependencies to/from statements that will be extracted |