@@ -89,10 +89,6 @@ static BN newInstance(final Ruby runtime, BigInteger value) {
89
89
return new BN (runtime , value != null ? value : BigInteger .ZERO );
90
90
}
91
91
92
- //static BN newInstance(final Ruby runtime, long value) {
93
- // return new BN(runtime, BigInteger.valueOf(value));
94
- //}
95
-
96
92
public static void createBN (final Ruby runtime , final RubyModule OpenSSL ) {
97
93
final RubyClass OpenSSLError = OpenSSL .getClass ("OpenSSLError" );
98
94
OpenSSL .defineClassUnder ("BNError" , OpenSSLError , OpenSSLError .getAllocator ());
@@ -164,7 +160,7 @@ public IRubyObject initialize(final ThreadContext context,
164
160
}
165
161
166
162
@ Override
167
- public synchronized IRubyObject initialize_copy (final IRubyObject that ) {
163
+ public IRubyObject initialize_copy (final IRubyObject that ) {
168
164
super .initialize_copy (that );
169
165
if ( this != that ) this .value = ((BN ) that ).value ;
170
166
return this ;
@@ -342,8 +338,18 @@ public IRubyObject ucmp(final ThreadContext context, IRubyObject other) {
342
338
return context .runtime .newFixnum ( value .abs ().compareTo ( asBigInteger (other ).abs () ) );
343
339
}
344
340
345
- @ JRubyMethod (name ={"eql?" , "==" , "===" })
346
- public RubyBoolean eql_p (final ThreadContext context , IRubyObject other ) {
341
+ @ JRubyMethod (name = "eql?" )
342
+ public IRubyObject eql_p (ThreadContext context , IRubyObject other ) {
343
+ return context .runtime .newBoolean (eql (other ));
344
+ }
345
+
346
+ @ Override
347
+ public boolean eql (IRubyObject other ) {
348
+ return equals (other );
349
+ }
350
+
351
+ @ JRubyMethod (name = "==" )
352
+ public IRubyObject op_equal (ThreadContext context , IRubyObject other ) {
347
353
return context .runtime .newBoolean ( value .equals ( asBigInteger (other ) ) );
348
354
}
349
355
0 commit comments