You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Behavior in Jruby 9.0.5.0 (jruby 9.0.5.0 (2.2.3) 2016-01-26 7bee00d Java HotSpot(TM) 64-Bit Server VM 25.101-b13 on 1.8.0_101-b13 +jit [Windows 10-amd64])
c:\tools>jruby foo.rb
start
foo
bar
baz
end
Behavior in Jruby 9.1.4.0 (jruby 9.1.4.0 (2.3.1) 2016-09-01 2e1327f Java HotSpot(TM) 64-Bit Server VM 25.101-b13 on 1.8.0_101-b13 +jit [mswin32-x86_64])
c:\tools>jruby foo.rb
start
Unhandled Java exception: java.lang.NullPointerException
java.lang.NullPointerException: null
unwrapJavaObject at org/jruby/javasupport/JavaUtil.java:287
each at org/jruby/javasupport/ext/JavaUtil.java:104
call at org/jruby/javasupport/ext/JavaUtil$Iterator$INVOKER$s$0$0$each.gen:-1
cacheAndCall at org/jruby/runtime/callsite/CachingCallSite.java:328
callBlock at org/jruby/runtime/callsite/CachingCallSite.java:141
call at org/jruby/runtime/callsite/CachingCallSite.java:145
invokeOther46:each at foo.rb:46
at foo.rb:46
invokeWithArguments at java/lang/invoke/MethodHandle.java:627
load at org/jruby/ir/Compiler.java:111
runScript at org/jruby/Ruby.java:834
runNormally at org/jruby/Ruby.java:749
runNormally at org/jruby/Ruby.java:767
runFromMain at org/jruby/Ruby.java:580
doRunFromMain at org/jruby/Main.java:425
internalRun at org/jruby/Main.java:313
run at org/jruby/Main.java:242
main at org/jruby/Main.java:204
Expected behavior is that Jruby 9.1.4.0 behaves as 9.0.5.0
The text was updated successfully, but these errors were encountered:
hey @slackfan, JRuby's Java integration part did receive a "rewrite" in 9.1 so that is now faster and more complete. seems like you found us a first regression. we will look into fixing this one. thanks.
... by moving .rb extensions to core Java types over from Ruby (in 9.1) and assuming they will be called on Java objects Ruby extensions do not work
e.g. a pure Ruby "included" java.lang.Iterable fails to keep its Ruby Enumerable nature working.
this only concerns enhanced interfaces and happens only if those enhanced methods are being re-used (from Ruby)
reported as jruby#4132
this is really unfortunate, but you might have to wait for 9.1.5.0 until its smoothed out.
when including "enhanced" interfaces (such as java.lang.Iterable, java.util.{Collection,List,Iterator,Enumeration}) in Ruby enhancements (such as the added Enumerable#each nature) will fail.
you can add the following patch as a temporary work-around (make sure its loaded before your part) :
Example code:
Behavior in Jruby 9.0.5.0 (jruby 9.0.5.0 (2.2.3) 2016-01-26 7bee00d Java HotSpot(TM) 64-Bit Server VM 25.101-b13 on 1.8.0_101-b13 +jit [Windows 10-amd64])
Behavior in Jruby 9.1.4.0 (jruby 9.1.4.0 (2.3.1) 2016-09-01 2e1327f Java HotSpot(TM) 64-Bit Server VM 25.101-b13 on 1.8.0_101-b13 +jit [mswin32-x86_64])
Expected behavior is that Jruby 9.1.4.0 behaves as 9.0.5.0
The text was updated successfully, but these errors were encountered: