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 expandCatchIfNecessary()
|
Method name: void expandParentsIfNecessary()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | int newSize = catchStack.length * 2;↵ | 1 | int newSize = parentStack.length * 2;↵ | |
2 | CatchTarget[] newCatchStack = new CatchTarget[newSize];↵ | 2 | RubyModule[] newParentStack = new RubyModule[newSize];↵ | |
3 | System.arraycopy(catchStack, 0, newCatchStack, 0, catchStack.length);↵ | 3 | System.arraycopy(parentStack, 0, newParentStack, 0, parentStack.length);↵ | |
4 | catchStack = newCatchStack; | 4 | parentStack = newParentStack; | |
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.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 16 |
Number of mapped statements | 2 |
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) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | int newSize = catchStack.length * 2; |
| 1 | int newSize = parentStack.length * 2; | ||||||||||||||
|
| 2 | RubyModule[] newParentStack = new RubyModule[newSize]; | |||||||||||||||
2 | CatchTarget[] newCatchStack = new CatchTarget[newSize]; |
| | |||||||||||||||
3 | System.arraycopy(catchStack, 0, newCatchStack, 0, catchStack.length); |
| 3 | System.arraycopy(parentStack, 0, newParentStack, 0, parentStack.length); | ||||||||||||||
| 4 | parentStack = newParentStack; | ||||||||||||||||
4 | catchStack = newCatchStack; | |
Row | Violation |
---|---|
1 | Type org.jruby.RubyKernel.CatchTarget[] of variable catchStack does not match with type org.jruby.RubyModule[] of variable parentStack |
2 | Unmatched statement RubyModule[] newParentStack=new RubyModule[newSize]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement CatchTarget[] newCatchStack=new CatchTarget[newSize]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Type org.jruby.RubyKernel.CatchTarget[] of variable catchStack does not match with type org.jruby.RubyModule[] of variable parentStack |