-
Bug
-
Resolution: Fixed
-
P5
-
1.4.2
-
None
-
merlin
-
generic
-
generic
We should not be using this method since it will be removed soon according to Peter Jones:
The private loadclass0() method is not
guaranteed to always exist, and in fact, I was planning on removing it
after Kestrel Beta. There is a new JVM function called
JVM_LatestUsedDefinedLoader() which achieves the important
functionality of loadClass0() instead with better orthogonality,
allowing us to fix a bug and remove the antiquated, deprecated
JVM_LoadClass0() function. We don't have to remove the private
ObjectInputStream.loadClass0() right away, but it is certainly
surprising to find out that some other code depends on its existence!
Especially through a native invocation. At any rate, the proper thing
for this specialLoadClass() to do would be to use this
JVM_LastUserDefinedLoader() function, which is a publicly-specified
function in the JVM interface, so it is more likely to not disappear in
the future.
Speaking of which, it seems like specialLoadClass() is native just so
that it can invoke a private method in another class, but you do not
need native code to do that: you can do that with reflection's access
override mechanism instead, and avoid the need to maintain more native
code.
The private loadclass0() method is not
guaranteed to always exist, and in fact, I was planning on removing it
after Kestrel Beta. There is a new JVM function called
JVM_LatestUsedDefinedLoader() which achieves the important
functionality of loadClass0() instead with better orthogonality,
allowing us to fix a bug and remove the antiquated, deprecated
JVM_LoadClass0() function. We don't have to remove the private
ObjectInputStream.loadClass0() right away, but it is certainly
surprising to find out that some other code depends on its existence!
Especially through a native invocation. At any rate, the proper thing
for this specialLoadClass() to do would be to use this
JVM_LastUserDefinedLoader() function, which is a publicly-specified
function in the JVM interface, so it is more likely to not disappear in
the future.
Speaking of which, it seems like specialLoadClass() is native just so
that it can invoke a private method in another class, but you do not
need native code to do that: you can do that with reflection's access
override mechanism instead, and avoid the need to maintain more native
code.