[erlang-patches] jinterface: workaround for a Java bug
Wed Nov 2 11:04:14 CET 2011
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