-
-
Notifications
You must be signed in to change notification settings - Fork 942
JRuby 9.1.0.0 Release Notes
JRuby 9000 is the new major version of JRuby, representing years of effort and large-scale reboots of several JRuby subsystems.
Major features of JRuby 9000:
- Ruby 2.x compatibility
- A new optimizing runtime based on a traditional compiler design
- New POSIX-friendly IO and Process
- Fully ported encoding/transcoding logic from MRI
- Ruby 2.3 Compatible (language and standard library) (i)
- Fixed performance and behavior regressions from 9.0.5.0
- Added several JIT optimizations missed in initial 9k release
- Fixed most of the outstanding parser bugs
- RubyGems updated to 2.6.4
- Many improvements to our Java Integration
- 114 issues fixed for 9.1.0.0
(i) We have a large majority of Ruby 2.3 features but we are not completely done. You can follow our remaining work by tracking this issue.
-
removing default
-Xmx(500MB) setting from jruby.bash. Most users that get JRuby will end up using the bash script. https://github.com/jruby/jruby/issues/3739 -
Thread.newand others spawning threads (Fiber,Enumerator) should be a bit faster to boot, most importantly they no longer possibly slow-down due low entropy sources on *nix systems due a JavaSecureRandominstantiation on JRuby'sThreadContext. https://github.com/jruby/jruby/pull/3723
-
Java stack-trace filtering was tuned to not exclude everything under the
org.jrubypackage prefix, we still avoid the additional noise from the stack-trace but no longer filter potentially unknown packages (e.g.org.jruby.rack) or extension stacks (org.jruby.ext). This change also affectsbacktraceinformation on the Ruby side which might now include more .java parts. -
the internal
JavaPackageModuleTemplatehas been refactored into a standalone module-like class, all package stubsorg.kares.jrubynow return aJavaPackageinstance (which is aModule) -
names
throwandcatchare no longer allowed as package names using the method format (org.jruby.catch will now dispatch toKernel.catch) - those are not valid Java package names anyways -
singleton_class(as well as hook methods such assingleton_method_added,singleton_method_removed) is no longer allowed as a package-name using the method ('.') format (org.jruby.singleton_classwill return the Ruby meta-class) -
pkg.to_snow returns package-name opposed to "module name" e.g.java.lang.to_s == 'java.lang'(note thatinspectstill behaves the same as before:java.lang.inspect == 'Java::JavaLang') -
improved
java.util.Mapequality (==,eql?) to other map/hash instances - previously wasn't 100% correct -
java.util.Mapproxies now support all ofHashmethods (including new ones such asdig,fetch_valuesand comparison operators e.g.<=) -
Java arrays now handle value equality
==with Ruby arrays (useeql?if types need to match as well). this also affects===with native arrays. -
Java's exception hierarchy
java.lang.Throwableno longer provides ato_strmethod, we feel like this unintentionally slipped probably due misunderstanding the difference between Ruby'sto_sandto_str -
java.util.Collectioninstances are no longerto_ary(Array-like) convertible, please note thatto_astill exists and (for compatibility)java.util.Listprovidesto_ary. -
unified
java.lang.Comparable#compareTowith incompatible types now raising TypeError -
java.util.Iterable#each(alsojava.util.Collection#each) now return an Enumerator when no block given -
java.util.Iterable#each_with_indexreturns Enumerator when no block given -
java.util.List#rindexnow using listIterator to loop backwards instead of get(index) -
java.util.List#sortdup-s - returns the same type as target (previously always returned an ArrayList) -
java.util.List#[]extension works as with Array (no Java index out of bounds errors) -
java.util.List#[]=extension behaves like with an Array (growing the list as needed) also element removal should be more efficient across different kinds of list implementations -
Ruby's
dupandclonemethods are expected to be working for most Collection types (except internal impl classes such as ones returned from java.util.Collections factories) -
(native) Java arrays now correctly dup
-
added java.util.regex.Pattern#casefold?
-
java.util.regex.Matcheris expected to quack very much like a RubyMatchData -
java.util.regex.Matchersupports named groups with begin/end (available on Java 8+) -
JRuby now provides ruby_xxx names for potentially conflicting methods e.g.
java.util.List#sorton Java 8java.util.ArrayList.class_eval { alias sort ruby_sort }will make all array listssortthe Ruby way while the instance is being used in Ruby scripts. -
Java interfaces no longer provide the (useless)
newmethod (e.g.java.lang.Runnable.new) -
method arities for generated Java methods (on Ruby class'
become_java!) have been improved so that when a Ruby method has fixed arity (e.g.foo(arg)) it will map to a correct Java method signature (foo(IRubyObject arg)) instead of always generating a generic var-args(IRubyObject[] args)method. -
Warbler has had issues with pre-compiled .rb files due broken IR de-serialization logic, we expect all issues to be fixed and added specs to cover previously failing issues.
-
jrubyc
--jdk5and-5switches were removed (Java 5 has not been supported for a while) -
jrubyc
--diroption now handles absolute paths correctly with the--targetoption