File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
main/java/org/jruby/ext/openssl Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -909,7 +909,7 @@ public static BigInteger getBigInteger(final IRubyObject arg) {
909
909
910
910
@ Override
911
911
public Object toJava (Class target ) {
912
- if ( target .isAssignableFrom (BigInteger .class ) || target == Number . class ) return value ;
912
+ if ( target .isAssignableFrom (BigInteger .class ) ) return value ;
913
913
if ( target == Long .class || target == Long .TYPE ) return value .longValue ();
914
914
if ( target == Integer .class || target == Integer .TYPE ) return value .intValue ();
915
915
if ( target == Double .class || target == Double .TYPE ) return value .doubleValue ();
Original file line number Diff line number Diff line change @@ -78,7 +78,9 @@ def test_comparison
78
78
79
79
def test_to_java
80
80
assert_equal java . lang . Integer . new ( 42 ) , OpenSSL ::BN . new ( '42' ) . to_java ( :int )
81
- assert_equal java . math . BigInteger . valueOf ( 24 ) , OpenSSL ::BN . new ( '24' ) . to_java
81
+ assert_equal java . math . BigInteger . valueOf ( 24 ) , val = OpenSSL ::BN . new ( '24' ) . to_java
82
+ assert_equal java . math . BigInteger , val . class
83
+ assert_equal java . math . BigInteger . valueOf ( 24 ) , val = OpenSSL ::BN . new ( '24' ) . to_java ( java . lang . Number )
82
84
end if defined? JRUBY_VERSION
83
85
84
86
def test_new_str
You can’t perform that action at this time.
0 commit comments