Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to call inherited instance method on Java class under OpenJDK 12 #5885

Closed
fidothe opened this issue Sep 22, 2019 · 4 comments
Closed

Unable to call inherited instance method on Java class under OpenJDK 12 #5885

fidothe opened this issue Sep 22, 2019 · 4 comments
Milestone

Comments

@fidothe
Copy link
Contributor

@fidothe fidothe commented Sep 22, 2019

Environment

JRuby 9.2.8.0, OpenJDK 12:

openjdk version "12.0.1" 2019-04-16
OpenJDK Runtime Environment (build 12.0.1+12)
OpenJDK 64-Bit Server VM (build 12.0.1+12, mixed mode, sharing)

uname -a: Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64

JRuby invoked via bundle exec / RSpec, JRUBY_OPTS empty:
bundle exec rspec spec

bundled gems:

$ bundle show
Gems included by the bundle:
  * addressable (2.4.0)
  * bundler (2.0.1)
  * crack (0.4.3)
  * diff-lcs (1.3)
  * docile (1.3.1)
  * hashdiff (0.3.8)
  * jar-dependencies (0.4.0)
  * json (2.2.0)
  * rake (12.3.2)
  * rspec (3.8.0)
  * rspec-core (3.8.0)
  * rspec-expectations (3.8.2)
  * rspec-mocks (3.8.0)
  * rspec-support (3.8.0)
  * safe_yaml (1.0.5)
  * saxon (0.2.2)
  * simplecov (0.16.1)
  * simplecov-html (0.10.2)
  * vcr (4.0.0)
  * webmock (2.3.2)
  * yard (0.9.18)

Expected Behavior

In the saxon-rb project, there should be no failing specs when running

bundle exec rspec spec/saxon/xslt/executable_spec.rb

https://github.com/fidothe/saxon-rb/blob/master/spec/saxon/xslt/executable_spec.rb

Actual Behaviour

Under JDK 1.8, there are no failures. Under OpenJDK 12 there are two, both NoMethodErrors resulting from calling an instance method of a Java class that is defined in a superclass.

The method is setInitialMode on an instance the class net.sf.saxon.s9api.Xslt30Transformer, from the Saxon 9.9.1.2 XML processing library. The method is defined on net.sf.saxon.s9api.AbstractXsltTransformer. The library can be downloaded from https://sourceforge.net/projects/saxon/files/Saxon-HE/9.9/

The error report is:

     NoMethodError:
       undefined method `setInitialMode' for #<Java::NetSfSaxonS9api::Xslt30Transformer:0x5d2e6f62>
       Did you mean?  set_initial_context_node

The Java packages are imported into a convenience module by the code in lib/saxon/loader.rb

@fidothe
Copy link
Contributor Author

@fidothe fidothe commented Sep 23, 2019

I put together a simplifed test case at https://github.com/fidothe/jrbug-5885, with a trivial JAR and a trivial ruby script that behaves the same locally. It's running with a ludicrous travis build matrix at the moment.

@fidothe
Copy link
Contributor Author

@fidothe fidothe commented Sep 23, 2019

I set up a travis build matrix (https://travis-ci.com/fidothe/jrbug-5885) that runs the examples against JRuby 9.2 and 9.1, and against OpenJDK 8 and 11. The failure happens for both 9.2 and 9.1 against OpenJDK 11, and they both succeed on OpenJDK 8.

@headius
Copy link
Member

@headius headius commented Sep 23, 2019

Confirmed with @fidothe that this is fixed on master (9.2.9).

@headius headius closed this Sep 23, 2019
@headius headius added this to the JRuby 9.2.9.0 milestone Sep 23, 2019
@fidothe
Copy link
Contributor Author

@fidothe fidothe commented Apr 30, 2020

This reappeared in 9.2.10 and is still there in 9.2.11, and now occurs in OpenJDK 8 too. I'll open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants