Time to repent

Some days ago I digged out, what turned to be a long-standing (JDK1.3 days) bug in the JNI specification
. Apparently, it still isn’t fixed. The issue in question is, should GetStringChars() return a zero-terminated string or not? The specification is silent about this, so a sane application developer MUST assume, it is not. A JVM developer is relatively free to return either a zero-terminated jchar array (like Hotspot does, but AFAICS, not always either), or not-zero-terminated jchar array (like a couple of VMs apparently do, like Jamaica, and I think gcj and jamvm too). It is a shame that this issue never has been fixed.

I posted to core-libs-dev@openjdk.java.net about this, and started an interesting little thread. The most hilarious response so far has been:

The developers at Sun found the correct way to interpreting the specification; the other ones followed it blindfolded. It is now time to repent.

Let me also quote Mark from IRC:

I guess it is a special kind of developers who can correctly interpret specs and Sun got them all 🙂

Unfortunately, fixing this on the side of Jamaica would mean relatively drastic changes to the internal string representation OR a very inefficient GetStringChars(). Bah.


One Response to Time to repent

  1. Quoting from IRC is not cool.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: