Skip to content

Commit 66b4da3

Browse files
committed
[refactor] work-around on BN#to_s impl which has been due JRuby 1.6
1 parent d203b46 commit 66b4da3

File tree

1 file changed

+6
-8
lines changed
  • src/main/java/org/jruby/ext/openssl

1 file changed

+6
-8
lines changed

src/main/java/org/jruby/ext/openssl/BN.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -178,22 +178,20 @@ public IRubyObject copy(IRubyObject other) {
178178
return this;
179179
}
180180

181-
@JRubyMethod(name = "to_s", rest = true, optional = 1)
181+
@Deprecated
182182
public RubyString to_s(IRubyObject[] args) {
183183
int argc = Arity.checkArgumentCount(getRuntime(), args, 0, 1);
184184
return to_s( argc == 1 ? RubyNumeric.num2int(args[0]) : 10 );
185185
}
186186

187-
// 1.6.8 can not handle - this way :
188-
189187
@Override
190-
//@JRubyMethod(name = "to_s")
188+
@JRubyMethod(name = "to_s")
191189
public RubyString to_s() { return to_s(10); }
192190

193-
//@JRubyMethod(name = "to_s")
194-
//public RubyString to_s(IRubyObject base) {
195-
// return to_s( RubyNumeric.num2int(base) );
196-
//}
191+
@JRubyMethod(name = "to_s")
192+
public RubyString to_s(IRubyObject base) {
193+
return to_s( RubyNumeric.num2int(base) );
194+
}
197195

198196
private RubyString to_s(final int base) {
199197
final Ruby runtime = getRuntime();

0 commit comments

Comments
 (0)