Affects Version/s: JRuby 1.7.0.pre1
Fix Version/s: JRuby 1.7.0.pre2
Component/s: Core Classes/Modules
Environment:I'm running Microsoft Windows Vista with Java Client VM 1.6.0_14, but I think the problem is likely to independent of the platform.
Number of attachments :
This seems to be a problem in 1.7.0.preview1 and in 1.6.7; I haven't tried it in other JRuby versions, but I suspect it will be a problem in other JRuby versions.
In JIRB or run as a JRuby program:
Looking at this code in RubyInteger.java it seems clear that the issue is "succ" does not check for Java long integer overflow for "getLongValue() + 1L".
RubyInteger.java 1.7.0.preview1 line 243
Looking at: RubyFixnum.java 1.7.0.preview1 line 353
suggests this possible patch:
or maybe this if there are performance (or other) reasons for using