int index = ++this.frameIndex;
Frame[] stack = frameStack;
stack[index].updateFrameForEval(self, file, line);
if (index + 1 == stack.length) {
expandFramesIfNecessary();
}
int index = ++this.frameIndex;
Frame[] stack = frameStack;
stack[index].updateFrame(name, file, line);
if (index + 1 == stack.length) {
expandFramesIfNecessary();
}
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/runtime/ThreadContext.java
|
|
File path: /jruby-1.4.0/src/org/jruby/runtime/ThreadContext.java
|
Method name: void pushEvalFrame(IRubyObject)
|
|
Method name: void pushFrame(String)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | int index = ++this.frameIndex;↵ | | 1 | int index = ++this.frameIndex;↵
|
2 | Frame[] stack = frameStack;↵ | | 2 | Frame[] stack = frameStack;↵
|
3 | stack[index].updateFrameForEval(self, file, line);↵ | | 3 | stack[index].updateFrame(name, file, line);↵
|
4 | if (index + 1 == stack.length) {↵ | | 4 | if (index + 1 == stack.length) {↵
|
5 | expandFramesIfNecessary();↵ | | 5 | expandFramesIfNecessary();↵
|
6 | } | | 6 | }
|
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 9 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 1.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | int index = ++this.frameIndex; | | 1 | int index = ++this.frameIndex; |
2 | Frame[] stack = frameStack; | | 2 | Frame[] stack = frameStack; |
| | | 3 | stack[index].updateFrame(name, file, line); |
3 | stack[index].updateFrameForEval(self, file, line); | | | |
4 | if (index + 1 == stack.length) | | 4 | if (index + 1 == stack.length) |
5 | expandFramesIfNecessary(); | | 5 | expandFramesIfNecessary(); |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables index, stack , while Clone fragment #2 returns variables index, stack |