File path: /jruby-1.4.0/src/org/jruby/RubyBignum.java | File path: /jruby-1.4.0/src/org/jruby/RubyBignum.java | |||
Method name: IRubyObject op_or(ThreadContext, IRubyObject)
|
Method name: IRubyObject op_xor(ThreadContext, IRubyObject)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | other = other.convertToInteger();↵ | 1 | other = other.convertToInteger();↵ | |
2 | if (other instanceof RubyBignum) {↵ | 2 | if (other instanceof RubyBignum) {↵ | |
3 | return bignorm(getRuntime(), value.or(((RubyBignum) other).value));↵ | 3 | return bignorm(getRuntime(), value.xor(((RubyBignum) other).value));↵ | |
4 | }↵ | 4 | }↵ | |
5 | if (other instanceof RubyFixnum) { // no bignorm here needed↵ | 5 | if (other instanceof RubyFixnum) {↵ | |
6 | return bignorm(getRuntime(), value.or(fix2big((RubyFixnum)other)));↵ | 6 | return bignorm(getRuntime(), value.xor(BigInteger.valueOf(((RubyFixnum) other).getLongValue())));↵ | |
7 | }↵ | 7 | }↵ | |
8 | return coerceBin(context, "|", other); | 8 | return coerceBin(context, "^", other); | |
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 17 |
Number of mapped statements | 5 |
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.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | other = other.convertToInteger(); | 1 | other = other.convertToInteger(); | |||||||||||||
2 | if (other instanceof RubyBignum) | 2 | if (other instanceof RubyBignum) | |||||||||||||
3 | return bignorm(getRuntime(), value.or(((RubyBignum)other).value)); |
| 3 | return bignorm(getRuntime(), value.xor(((RubyBignum)other).value)); | ||||||||||||
4 | if (other instanceof RubyFixnum) | 4 | if (other instanceof RubyFixnum) | |||||||||||||
|
| 5 | return bignorm(getRuntime(), value.xor(BigInteger.valueOf(((RubyFixnum)other).getLongValue()))); | |||||||||||||
5 | return bignorm(getRuntime(), value.or(fix2big((RubyFixnum)other))); |
| | |||||||||||||
6 | return coerceBin(context, "|", other); |
| 6 | return coerceBin(context, "^", other); |
Row | Violation |
---|---|
1 | Expression value.or(((RubyBignum)other).value) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression value.xor(((RubyBignum)other).value) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement return bignorm(getRuntime(),value.xor(BigInteger.valueOf(((RubyFixnum)other).getLongValue()))); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Unmatched return bignorm(getRuntime(),value.xor(BigInteger.valueOf(((RubyFixnum)other).getLongValue()))); |
5 | Unmatched statement return bignorm(getRuntime(),value.or(fix2big((RubyFixnum)other))); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
6 | Unmatched return bignorm(getRuntime(),value.or(fix2big((RubyFixnum)other))); |