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

JNI FindClass accepts class descriptors in signature form

XMLWordPrintable

    • generic
    • generic

      After fix of CR 6215975 "FindClass documentation clarification" in Mustang
      the updated JNI specification states the following for FindClass function:
        ---Excerpt-from-spec---
        jclass FindClass(JNIEnv *env, const char *name);

        This function loads a locally-defined class. It searches the directories
        and zip files specified by the CLASSPATH environment variable for the class
        with the specified name.
        The name argument is a class descriptor ( §12.3.2). For example, the descriptor
        for the java.lang.String class is:
                         "java/lang/String"
        The descriptor of the array class java.lang.Object[] is:
                         "[Ljava/lang/Object;"
        ---End-of-excerpt---

      However, Sun's JDK (at least 5.0/6.0) permits "Lcom/test/test/Test;"
      as name parameter for FindClass, though the name is incorrect here according
      to both updated/1.5 JNI specs (for FindClass):
        http://download.java.net/jdk6/doc/guide/jni/spec/functions.html
      and JVMS (Chapter 4.2, "The Internal Form of Fully Qualified Class and Interface Names"):
        http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#14757

      If compatibility permits, the implementation should be tightened to disallow this.

            iklam Ioi Lam
            sbohne Steve Bohne (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: