Skip to content

Commit 7613880

Browse files
committed
accept CharSequence on debug/warn (internal) helpers
1 parent 74e742e commit 7613880

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,18 +216,22 @@ static void debugStackTrace(final Ruby runtime, final Throwable e) {
216216
if ( isDebug(runtime) ) e.printStackTrace(runtime.getOut());
217217
}
218218

219-
public static void debug(final Ruby runtime, final String msg) {
220-
if ( isDebug(runtime) ) runtime.getOut().println(msg);
219+
public static void debug(final Ruby runtime, final CharSequence msg) {
220+
if ( isDebug(runtime) ) runtime.getOut().println(msg.toString());
221221
}
222222

223-
public static void debug(final Ruby runtime, final String msg, final Throwable e) {
224-
if ( isDebug(runtime) ) runtime.getOut().println(msg + ' ' + e);
223+
public static void debug(final Ruby runtime, final CharSequence msg, final Throwable e) {
224+
if ( isDebug(runtime) ) runtime.getOut().println(msg.toString() + ' ' + e);
225225
}
226226

227-
static void warn(final ThreadContext context, final String msg) {
227+
static void warn(final ThreadContext context, final CharSequence msg) {
228228
warn(context, RubyString.newString(context.runtime, msg));
229229
}
230230

231+
static void warn(final ThreadContext context, final RubyString msg) {
232+
warn(context, (IRubyObject) msg);
233+
}
234+
231235
static void warn(final ThreadContext context, final IRubyObject msg) {
232236
if ( warn ) context.runtime.getModule("OpenSSL").callMethod(context, "warn", msg);
233237
}

0 commit comments

Comments
 (0)