ObjectOutputStream.java: Add DEBUG statements everywhere.
2004-06-21 Andrew Haley <aph@redhat.com> * java/io/ObjectOutputStream.java: Add DEBUG statements everywhere. (dumpElementln): New method. (depth): New field. * java/io/ObjectInputStream.java (currentClassLoader): Make native. (callersClassLoader): New field. (depth): New field. (readObject): ENDBLOCKDATA is generated if the class has a write method, not if it has a read method. (readObject): Save and restore this.currentObject and this.currentObjectStreamClass around calls to callReadMethod(). * java/io/natObjectInputStream.cc (getCallersClassLoader): New method. From-SVN: r83440
This commit is contained in:
parent
413ed876c5
commit
deb3d52fec
4 changed files with 178 additions and 38 deletions
|
@ -19,6 +19,8 @@ details. */
|
|||
#include <java/lang/Class.h>
|
||||
#include <java/lang/reflect/Modifier.h>
|
||||
#include <java/lang/reflect/Method.h>
|
||||
#include <java/lang/ArrayIndexOutOfBoundsException.h>
|
||||
#include <java/lang/SecurityManager.h>
|
||||
|
||||
#ifdef DEBUG
|
||||
#include <java/lang/System.h>
|
||||
|
@ -69,3 +71,33 @@ java::io::ObjectInputStream::callConstructor (jclass klass, jobject obj)
|
|||
+ m->offset);
|
||||
_Jv_CallAnyMethodA (obj, JvPrimClass (void), meth, false, arg_types, NULL);
|
||||
}
|
||||
|
||||
java::lang::ClassLoader*
|
||||
java::io::ObjectInputStream::getCallersClassLoader ()
|
||||
{
|
||||
java::lang::ClassLoader *loader = NULL;
|
||||
gnu::gcj::runtime::StackTrace *t
|
||||
= new gnu::gcj::runtime::StackTrace(4);
|
||||
java::lang::Class *klass = NULL;
|
||||
try
|
||||
{
|
||||
for (int i = 2; !klass; i++)
|
||||
{
|
||||
klass = t->classAt (i);
|
||||
}
|
||||
loader = klass->getClassLoaderInternal();
|
||||
}
|
||||
catch (::java::lang::ArrayIndexOutOfBoundsException *e)
|
||||
{
|
||||
// FIXME: RuntimeError
|
||||
}
|
||||
|
||||
return loader;
|
||||
}
|
||||
|
||||
java::lang::ClassLoader*
|
||||
java::io::ObjectInputStream::currentClassLoader (::java::lang::SecurityManager *sm)
|
||||
{
|
||||
return sm->currentClassLoader ();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue