Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4526746

JNI version number should be incremented for 1.4

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.4.0
    • hotspot
    • rc1
    • generic
    • generic

      A member of the JSR-51 (NIO) expert group has pointed out that we added some
      new functionality to JNI in Merlin, but we didn't increment the JNI version
      number.

      This is inconsistent with past practice. When we extended JNI in 1.2 we
      incremented the version number to 0x00010002 and defined the new version
      constant JNI_VERSION_1_2 in jni.h. In Merlin we should correspondingly define
      JNI_VERSION_1_4.

      This oversight also makes it difficult for native code to detect which version
      of JNI it's using at runtime and adjust accordingly. There is a workaround,
      namely to do a FindClass on a class that's known only to exist in 1.4, but
      that's pretty ugly.

      The risk of incrementing the version number at this late stage might not be all
      that great. Native code that never examines the version number will not be
      affected. Native code that defensively checks whether the version number is
      greater than or equal to a fixed value (e.g., >= JNI_VERSION_1_2) will also not
      be affected. The only native code that will be affected is that which tests
      for specific version numbers and otherwise fails. (Such code is arguably
      poorly written, but of course that doesn't mean it doesn't exist.)

      -- ###@###.### 2001/11/13

            mr Mark Reinhold
            mr Mark Reinhold
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: