Commit a53785f9 by Warren Levy Committed by Warren Levy

ObjectInputStream.java (readObject): Added code to conditionally dump out the serialized data.

	* java/io/ObjectInputStream.java (readObject): Added code to
	conditionally dump out the serialized data.
	Handle ENDBLOCKDATA case a bit more gracefully since the current
	behavior doesn't seem to work as expected.
	(readStreamHeader): Added code for serialized data dumper.
	(readNextBlock): Ditto.
	(readFields): Ditto.
	(dump): New private static field for turning on/off dumper.
	(setDump): New native method.
	(dumpElement): New native method.
	(dumpElementln): New native method.
	* java/io/natObjectInputStream.cc (setDump): New method.
	(dumpElement): New method.
	(dumpElementln): New method.

Serialization dumper.  Enable by configuring with --enable-libgcj-debug
and calling java.io.ObjectInputStream.setDump(true) in your test program.
The output will be generated as the object is deserialized (i.e. the
readObject() method is executed).

From-SVN: r37223
parent 6678181b
2000-11-02 Warren Levy <warrenl@cygnus.com> 2000-11-02 Warren Levy <warrenl@cygnus.com>
* java/io/ObjectInputStream.java (readObject): Added code to
conditionally dump out the serialized data.
Handle ENDBLOCKDATA case a bit more gracefully since the current
behavior doesn't seem to work as expected.
(readStreamHeader): Added code for serialized data dumper.
(readNextBlock): Ditto.
(readFields): Ditto.
(dump): New private static field for turning on/off dumper.
(setDump): New native method.
(dumpElement): New native method.
(dumpElementln): New native method.
* java/io/natObjectInputStream.cc (setDump): New method.
(dumpElement): New method.
(dumpElementln): New method.
2000-11-02 Warren Levy <warrenl@cygnus.com>
* java/net/InetAddress.java (addr): Renamed from 'address'. * java/net/InetAddress.java (addr): Renamed from 'address'.
(address): New field to match Serialized Form doc. (address): New field to match Serialized Form doc.
(hostName): Renamed from 'hostname' to match Serialized Form doc. (hostName): Renamed from 'hostname' to match Serialized Form doc.
......
...@@ -20,6 +20,11 @@ details. */ ...@@ -20,6 +20,11 @@ details. */
#include <java/lang/reflect/Modifier.h> #include <java/lang/reflect/Modifier.h>
#include <java/lang/reflect/Method.h> #include <java/lang/reflect/Method.h>
#ifdef DEBUG
#include <java/lang/System.h>
#include <java/io/PrintStream.h>
#endif
jobject jobject
java::io::ObjectInputStream::allocateObject (jclass klass) java::io::ObjectInputStream::allocateObject (jclass klass)
{ {
...@@ -74,3 +79,39 @@ java::io::ObjectInputStream::getMethod (jclass klass, jstring name, ...@@ -74,3 +79,39 @@ java::io::ObjectInputStream::getMethod (jclass klass, jstring name,
return klass->getPrivateMethod (name, arg_types); return klass->getPrivateMethod (name, arg_types);
} }
#ifdef DEBUG
void
java::io::ObjectInputStream::setDump (jboolean dump)
{
java::io::ObjectInputStream::dump = dump;
}
void
java::io::ObjectInputStream::dumpElement (jstring msg)
{
if (dump)
java::lang::System::out->print (msg);
}
void
java::io::ObjectInputStream::dumpElementln (jstring msg)
{
if (dump)
java::lang::System::out->println (msg);
}
#else
void
java::io::ObjectInputStream::setDump (jboolean dump)
{
}
void
java::io::ObjectInputStream::dumpElement (jstring msg)
{
}
void
java::io::ObjectInputStream::dumpElementln (jstring msg)
{
}
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment