Conversation
Two ByteLists may have exactly the same bytes, but not the same encoding. Such ByteLists have been treated as equals() but we have frequently run into bugs from this behavior. This PR finally adds encoding to the conditions required for ByteList equality.
|
Note that the caching in #9644 depends on true ByteList equality, so this will probably be required to ship that PR as it is currently implemented. |
|
A good experiment but we appear to have many places that depend on ByteList equality only considering the contents of the byte array. It fails at startup, most likely because two versions of the ByteList for the core/src/main/ruby/jruby/java/core_ext/object.rb: Resulting error: Likely source of the problem: jruby/core/src/main/java/org/jruby/parser/RubyParserBase.java Lines 1332 to 1340 in 6cdb065 The symbol table is keyed on ByteList, and the code parsed here may be producing two bytelists with the same content but different encodings (US-ASCII vs UTF-8 for example). |
Two ByteLists may have exactly the same bytes, but not the same encoding. Such ByteLists have been treated as equals() but we have frequently run into bugs from this behavior. This PR finally adds encoding to the conditions required for ByteList equality.