This is the mail archive of the java-discuss@sources.redhat.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Array classes and class loaders


_Jv_CreateArrayClass has a "loader" parameter:

jclass
_Jv_CreateArrayClass (jclass element, java::lang::ClassLoader *loader,

        _Jv_VTable *array_vtable)

And it seems that the classloader of the class creating the array is
used as the classloader of the array type:

  // vmspec, section 5.3.3 describes this
  if (element->loader != loader)
    _Jv_RegisterInitiatingLoader (array_class, loader);

But in the JDK 1.3 html documentation for java.lang.ClassLoader we
have:

"Class objects for array classes are not created by class loaders, but
are created automatically as required by the Java runtime. The class
loader for an array class, as returned by Class.getClassLoader() is
the same as the class loader for its element type; if the element type
is a primitive type, then the array class has no class loader. "

Who's right? The later approach would make life a lot easier.

regards

  [ bryce ]



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]