Skip to content

Commit 7b9d10c

Browse files
committed
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.
1 parent af50867 commit 7b9d10c

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

ext/java/org/jruby/ext/psych/PsychParser.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,6 @@ public PsychParser(Ruby runtime, RubyClass klass) {
108108
super(runtime, klass);
109109
}
110110

111-
@JRubyMethod
112-
public IRubyObject parse(ThreadContext context, IRubyObject yaml) {
113-
Ruby runtime = context.runtime;
114-
115-
return parse(context, yaml, runtime.getNil());
116-
}
117-
118111
private IRubyObject stringOrNilFor(ThreadContext context, String value, boolean tainted) {
119112
if (value == null) return context.nil;
120113

@@ -192,8 +185,8 @@ private StreamReader readerFor(ThreadContext context, IRubyObject yaml) {
192185
}
193186
}
194187

195-
@JRubyMethod
196-
public IRubyObject parse(ThreadContext context, IRubyObject yaml, IRubyObject path) {
188+
@JRubyMethod(name = "_native_parse")
189+
public IRubyObject parse(ThreadContext context, IRubyObject handler, IRubyObject yaml, IRubyObject path) {
197190
Ruby runtime = context.runtime;
198191
boolean tainted = yaml.isTaint() || yaml instanceof RubyIO;
199192

@@ -204,8 +197,6 @@ public IRubyObject parse(ThreadContext context, IRubyObject yaml, IRubyObject pa
204197
path = yaml.callMethod(context, "path");
205198
}
206199

207-
IRubyObject handler = getInstanceVariable("@handler");
208-
209200
while (true) {
210201
event = parser.getEvent();
211202

0 commit comments

Comments
 (0)