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 pushCatch(CatchTarget)
|
Method name: void pushRubyClass(RubyModule)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | int index = ++catchIndex;↵ | 1 | int index = ++parentIndex;↵ | |
2 | CatchTarget[] stack = catchStack;↵ | 2 | RubyModule[] stack = parentStack;↵ | |
3 | stack[index] = catchTarget;↵ | 3 | stack[index] = currentModule;↵ | |
4 | if (index + 1 == stack.length) {↵ | 4 | if (index + 1 == stack.length) {↵ | |
5 | expandCatchIfNecessary();↵ | 5 | expandParentsIfNecessary();↵ | |
6 | } | 6 |
| |
See real code fragment | See real code fragment |
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 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 1.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | int index = ++catchIndex; |
| 1 | int index = ++parentIndex; | ||||||||||||
| 2 | RubyModule[] stack = parentStack; | ||||||||||||||
2 | CatchTarget[] stack = catchStack; | | ||||||||||||||
|
| 3 | stack[index] = currentModule; | |||||||||||||
3 | stack[index] = catchTarget; |
| | |||||||||||||
4 | if (index + 1 == stack.length) |
| 4 | if (index + 1 == stack.length) | ||||||||||||
5 | expandCatchIfNecessary(); |
| 5 | expandParentsIfNecessary(); |
Row | Violation |
---|---|
1 | Expression catchIndex is a field being modified, and thus it cannot be parameterized |
2 | Expression parentIndex is a field being modified, and thus it cannot be parameterized |
3 | Unmatched statement stack[index]=currentModule; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement stack[index]=catchTarget; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Type org.jruby.RubyKernel.CatchTarget[] of variable stack does not match with type org.jruby.RubyModule[] of variable stack |
6 | Expression expandCatchIfNecessary() is a void method call, and thus it cannot be parameterized |
7 | Expression expandParentsIfNecessary() is a void method call, and thus it cannot be parameterized |