|
49 | 49 | import org.jruby.javasupport.JavaUtil;
|
50 | 50 | import org.jruby.runtime.Block;
|
51 | 51 | import org.jruby.runtime.Helpers;
|
| 52 | +import org.jruby.runtime.JavaSites; |
52 | 53 | import org.jruby.runtime.ThreadContext;
|
53 | 54 | import org.jruby.runtime.builtin.IRubyObject;
|
54 | 55 | import org.jruby.runtime.callsite.CachingCallSite;
|
@@ -248,8 +249,9 @@ public IRubyObject parse(ThreadContext context, IRubyObject handler, IRubyObject
|
248 | 249 | LoadSettings loadSettings = loadSettingsBuilder.build();
|
249 | 250 | parser = new ParserImpl(loadSettings, new ScannerImpl(loadSettings, readerFor(context, yaml, loadSettings)));
|
250 | 251 |
|
251 |
| - if (path.isNil() && yaml.respondsTo("path")) { |
252 |
| - path = sites.path.call(context, this, yaml); |
| 252 | + JavaSites.CheckedSites pathSites = sites.path; |
| 253 | + if (path.isNil() && pathSites.respond_to_X.respondsTo(context, yaml, yaml)) { |
| 254 | + path = pathSites.site.call(context, this, yaml); |
253 | 255 | }
|
254 | 256 |
|
255 | 257 | while (parser.hasNext()) {
|
@@ -651,7 +653,7 @@ private LoadSettings buildSettings() {
|
651 | 653 | private final CallSites sites;
|
652 | 654 |
|
653 | 655 | private static class CallSites {
|
654 |
| - private final CachingCallSite path = new FunctionalCachingCallSite("path"); |
| 656 | + private final JavaSites.CheckedSites path = new JavaSites.CheckedSites("path"); |
655 | 657 | private final CachingCallSite event_location = new FunctionalCachingCallSite("event_location");
|
656 | 658 | private final CachingCallSite start_stream = new FunctionalCachingCallSite("start_stream");
|
657 | 659 | private final CachingCallSite start_document = new FunctionalCachingCallSite("start_document");
|
|
0 commit comments