assert offset < SIZE : SIZE_ERROR;
switch (offset) {
case 0:
return variableValueZero = value;
case 1:
return variableValueOne = value;
default:
throw new RuntimeException(SIZE_ERROR);
}
assert offset < SIZE : SIZE_ERROR;
switch (offset) {
case 0:
return variableValueZero = value;
case 1:
return variableValueOne = value;
default:
throw new RuntimeException(SIZE_ERROR);
}
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/runtime/scope/TwoVarDynamicScope.java
|
|
File path: /jruby-1.4.0/src/org/jruby/runtime/scope/TwoVarDynamicScope.java
|
Method name: IRubyObject setValue(int, IRubyObject, int)
|
|
Method name: IRubyObject setValueDepthZero(IRubyObject, int)
|
Number of AST nodes: 8
|
|
Number of AST nodes: 8
|
|
1 | assert offset < SIZE : SIZE_ERROR;↵ | | 1 | assert offset < SIZE : SIZE_ERROR;↵
|
2 | switch (offset) {↵ | | 2 | switch (offset) {↵
|
3 | case 0:↵ | | 3 | case 0:↵
|
4 | return variableValueZero = value;↵ | | 4 | return variableValueZero = value;↵
|
5 | case 1:↵ | | 5 | case 1:↵
|
6 | return variableValueOne = value;↵ | | 6 | return variableValueOne = value;↵
|
7 | default:↵ | | 7 | default:↵
|
8 | throw new RuntimeException(SIZE_ERROR);↵ | | 8 | throw new RuntimeException(SIZE_ERROR);↵
|
9 | } | | 9 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 26 |
-
{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) | 0.9 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
4 | assert offset < SIZE : SIZE_ERROR; | | 1 | assert offset < SIZE : SIZE_ERROR; |
5 | switch (offset) | | 2 | switch (offset) |
6 | | | 3 | |
7 | return variableValueZero = value; | | 4 | return variableValueZero = value; |
8 | | | 5 | |
9 | return variableValueOne = value; | | 6 | return variableValueOne = value; |
10 | | | 7 | |
11 | throw new RuntimeException(SIZE_ERROR); | | 8 | throw new RuntimeException(SIZE_ERROR); |
Precondition Violations (0)
Row |
Violation |