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

GetClassLoaderClasses does not return primitive arrays

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.4.0
    • 1.3.0, 1.4.0
    • vm-legacy
    • None
    • beta2
    • generic, x86
    • generic, windows_nt
    • Verified

      http://java.sun.com/docs/books/vmspec/2nd-edition/html/ConstantPool.doc.html#79473

      From the JVM spec section 5.3.3:

         2. The Java virtual machine creates a new array class with the indicated component type and number of dimensions. If the
            component type is a reference type, C is marked as having been defined by the defining class loader of the component type.
            Otherwise, C is marked as having been defined by the bootstrap class loader. In any case, the Java virtual machine then
            records that L is an initiating loader for C (§5.3.4). ...

      The last sentence is clear that, for creation, all arrays have their initiating class loader marked. The prefacing sentence
      indicates that the information is used and that it would be considered a creation since it is not already an initiating loader
      of the array:

            If L has already been recorded as an initiating loader of an array class with the same component type as N, that
            class is C, and no array class creation is necessary Otherwise, the following steps are performed to create C:

      JVMDI function GetClassLoaderClasses is defined:

            Returns an array of all classes for which this class loader has been recorded as the initiating loader.

      The related JVMDI function, GetLoadedClasses, is specific that primitive arrays are included:

            Array classes of all types (including arrays of primitive types) are included in the returned list. Primitive
            classes (for example, java.lang.Integer.TYPE) are not included in this list.

      HotSpot build 1.4.0-beta-b61 does not return primitive arrays such as "int[]".

      robert.field@Eng 2001-04-24

      Note: this will indirectly cause the JDI methods:

      Field.type()
      Method.returnType()
      Method.argumentTypes()?
      LocalVariable.type()
      others...?

      to incorrectly throw ClassNotLoadedException.
      robert.field@Eng 2001-04-27

            mchung Mandy Chung
            rfield Robert Field (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: