other = other.convertToInteger();
if (other instanceof RubyBignum) {
return bignorm(getRuntime(), value.and(((RubyBignum) other).value));
} else if (other instanceof RubyFixnum) {
return bignorm(getRuntime(), value.and(fix2big((RubyFixnum)other)));
}
return coerceBin(context, "&", other);
other = other.convertToInteger();
if (other instanceof RubyBignum) {
return bignorm(getRuntime(), value.or(((RubyBignum) other).value));
}
if (other instanceof RubyFixnum) { // no bignorm here needed
return bignorm(getRuntime(), value.or(fix2big((RubyFixnum)other)));
}
return coerceBin(context, "|", other);
Clone fragments detected by clone detection tool
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_and(ThreadContext, IRubyObject)
|
|
Method name: IRubyObject op_or(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.and(((RubyBignum) other).value));↵ | | 3 | return bignorm(getRuntime(), value.or(((RubyBignum) other).value));↵
|
4 | } else↵ | | 4 | }↵
|
5 | if (other instanceof RubyFixnum) {↵ | | 5 | if (other instanceof RubyFixnum) { // no bignorm here needed↵
|
6 | return bignorm(getRuntime(), value.and(fix2big((RubyFixnum)other)));↵ | | 6 | return bignorm(getRuntime(), value.or(fix2big((RubyFixnum)other)));↵
|
7 | }↵ | | 7 | }↵
|
8 | return coerceBin(context, "&", other); | | 8 | return coerceBin(context, "|", other);
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 0 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 0 |
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 | 4 |