[erlang-patches] jinterface: workaround for a Java bug
Wed Nov 23 08:57:47 CET 2011
I have a test for this, but I couldn't test it with Java 1.5, as it's
a hell to try to install it in a newer Ubuntu. Please let me know if
you want to include it anyway or if Java 5 is to be considered
deprecated (it already passed its end-of-life and premier commercial
support is also not available anymore).
On Wed, Nov 2, 2011 at 11:04, Henrik Nord <> wrote:
> On 10/20/2011 02:38 PM, Vlad Dumitrescu wrote:
>> git fetch git://github.com/vladdu/opt.git java_string_bug
>> OtpErlangString is affected by Java bug
>> Java 1.5 has a bug where detecting codepoint offsets in strings that are
>> created by String.substring() gives wrong results. The new implementation
>> uses a different method, avoinding the issue.
>> The following code will crash without the fix:
>> final String s = "abcdefg";
>> final String ss = s.substring(3, 6);
>> final int cps = OtpErlangString.stringToCodePoints(ss);
>> erlang-patches mailing list
> We would like a test for this.
> The suggestion is to extend the lists_roundtrip_2 test in nc_SUIT.erl by
> adding a new tag for the codepoint operation, and consequently adding the
> same to echo_server.java similar to how "sub3atom" is done.
> Thank you for the contribution!
> /Henrik Nord Erlang/OTP
More information about the erlang-patches