-
-
Notifications
You must be signed in to change notification settings - Fork 902
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
XmlNodeSet.to_s return value conflicts with JRuby 9.2.9 #1968
Labels
Milestone
Comments
Originally reported in a comment to #1253. |
headius
added a commit
to headius/nokogiri
that referenced
this issue
Jan 14, 2020
The existing signature conflicts with one added to JRuby 9.2.9. Specifically, the new signature in JRuby returns RubyArray, which causes a compilation error on this line in Nokogiri because it attempts to use a more general return type. We would prefer to keep the specific return type in JRuby. * If we patch JRuby, then 9.2.9 will never be able to compile any version of Nokogiri. * If we patch Nokogiri, all versions of JRuby can compile current and future Nokogiri. Versions prior to 9.2.9 will be able to compile all existing releases of Nokogiri. I do not believe the change in 9.2.9 breaks anything at runtime, since the JVM does not care about this particular return type mismatch unless someone actually returns a non-RubyArray object. Fixes sparklemotion#1968
headius
added a commit
to headius/nokogiri
that referenced
this issue
Jan 14, 2020
The existing signature conflicts with one added to JRuby 9.2.9. Specifically, the new signature in JRuby returns RubyArray, which causes a compilation error on this line in Nokogiri because it attempts to use a more general return type. We would prefer to keep the specific return type in JRuby. * If we patch JRuby, then 9.2.9 will never be able to compile any version of Nokogiri. * If we patch Nokogiri, all versions of JRuby can compile current and future Nokogiri. Versions prior to 9.2.9 will be able to compile all existing releases of Nokogiri. I do not believe the change in 9.2.9 breaks anything at runtime, since the JVM does not care about this particular return type mismatch unless someone actually returns a non-RubyArray object. Fixes sparklemotion#1968
PR merged, will be fixed in v1.11.0. |
flavorjones
pushed a commit
that referenced
this issue
Mar 1, 2020
The existing signature conflicts with one added to JRuby 9.2.9. Specifically, the new signature in JRuby returns RubyArray, which causes a compilation error on this line in Nokogiri because it attempts to use a more general return type. We would prefer to keep the specific return type in JRuby. * If we patch JRuby, then 9.2.9 will never be able to compile any version of Nokogiri. * If we patch Nokogiri, all versions of JRuby can compile current and future Nokogiri. Versions prior to 9.2.9 will be able to compile all existing releases of Nokogiri. I do not believe the change in 9.2.9 breaks anything at runtime, since the JVM does not care about this particular return type mismatch unless someone actually returns a non-RubyArray object. Fixes #1968
This was referenced Mar 12, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
XmlNodeSet defines a
to_a
method here:nokogiri/ext/java/nokogiri/XmlNodeSet.java
Line 395 in 84a554f
JRuby originally defined a superclass
to_a
method (in RubyBasicObject) that did not take aThreadContext
parameter. However in JRuby 9.2.9, we made another set of changes to passThreadContext
through more methods, including theto_a
in RubyBasicObject. This added a new signatureRubyArray to_a(ThreadContext)
with the oldRubyArray to_a()
left deprecated.As a result, the method in XmlNodeSet no longer compiles because it attempts to return a more general type (IRubyObject as opposed to RubyArray).
The text was updated successfully, but these errors were encountered: