From 7b9d10c9dc2bb4dd71cb44f77d209a9f05f7def8 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Mon, 19 Sep 2022 11:39:25 -0500 Subject: Unbreak JRuby ext parse method The changes in #580 renamed the native parse method and changed its signature to be fixed-arity with three arguments. This patch makes the same change to the JRuby extension to unbreak it. --- ext/java/org/jruby/ext/psych/PsychParser.java | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'ext') diff --git a/ext/java/org/jruby/ext/psych/PsychParser.java b/ext/java/org/jruby/ext/psych/PsychParser.java index 8539110..9d116fa 100644 --- a/ext/java/org/jruby/ext/psych/PsychParser.java +++ b/ext/java/org/jruby/ext/psych/PsychParser.java @@ -108,13 +108,6 @@ public class PsychParser extends RubyObject { super(runtime, klass); } - @JRubyMethod - public IRubyObject parse(ThreadContext context, IRubyObject yaml) { - Ruby runtime = context.runtime; - - return parse(context, yaml, runtime.getNil()); - } - private IRubyObject stringOrNilFor(ThreadContext context, String value, boolean tainted) { if (value == null) return context.nil; @@ -192,8 +185,8 @@ public class PsychParser extends RubyObject { } } - @JRubyMethod - public IRubyObject parse(ThreadContext context, IRubyObject yaml, IRubyObject path) { + @JRubyMethod(name = "_native_parse") + public IRubyObject parse(ThreadContext context, IRubyObject handler, IRubyObject yaml, IRubyObject path) { Ruby runtime = context.runtime; boolean tainted = yaml.isTaint() || yaml instanceof RubyIO; @@ -204,8 +197,6 @@ public class PsychParser extends RubyObject { path = yaml.callMethod(context, "path"); } - IRubyObject handler = getInstanceVariable("@handler"); - while (true) { event = parser.getEvent(); -- cgit v1.2.1