File tree Expand file tree Collapse file tree
main/java/org/jruby/ext/openssl Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -909,7 +909,7 @@ public static BigInteger getBigInteger(final IRubyObject arg) {
909909
910910 @ Override
911911 public Object toJava (Class target ) {
912- if ( target .isAssignableFrom (BigInteger .class ) || target == Number . class ) return value ;
912+ if ( target .isAssignableFrom (BigInteger .class ) ) return value ;
913913 if ( target == Long .class || target == Long .TYPE ) return value .longValue ();
914914 if ( target == Integer .class || target == Integer .TYPE ) return value .intValue ();
915915 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
7878
7979 def test_to_java
8080 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 )
8284 end if defined? JRUBY_VERSION
8385
8486 def test_new_str
You can’t perform that action at this time.
0 commit comments