diff options
author | Andrew Haley <aph@redhat.com> | 2007-04-16 15:29:55 +0000 |
---|---|---|
committer | Andrew Haley <aph@gcc.gnu.org> | 2007-04-16 15:29:55 +0000 |
commit | 8734935bf8996030f2eeafac3cdbb95434339294 (patch) | |
tree | 25738fc298f81741e0e7a03b01270a62de4f5762 /libjava | |
parent | bdbf40a53653d4e4f069370e328653b73ed10e66 (diff) | |
download | gcc-8734935bf8996030f2eeafac3cdbb95434339294.zip gcc-8734935bf8996030f2eeafac3cdbb95434339294.tar.gz gcc-8734935bf8996030f2eeafac3cdbb95434339294.tar.bz2 |
ObjectInputStream.java: (parseContent): Call (String, Object) version of dumpElementln.
2007-04-16 Andrew Haley <aph@redhat.com>
* java/io/ObjectInputStream.java: (parseContent): Call (String,
Object) version of dumpElementln.
(dumpElementln(String, Object)): New method.
* java/io/ObjectOutputStream.java (writeObject): Call (String,
Object) version of dumpElementln.
(dumpElementln(String, Object)): New method.
From-SVN: r123875
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/classpath/ChangeLog | 9 | ||||
-rw-r--r-- | libjava/classpath/java/io/ObjectInputStream.java | 20 | ||||
-rw-r--r-- | libjava/classpath/java/io/ObjectOutputStream.java | 32 |
3 files changed, 55 insertions, 6 deletions
diff --git a/libjava/classpath/ChangeLog b/libjava/classpath/ChangeLog index 84f4c68..712c9eb 100644 --- a/libjava/classpath/ChangeLog +++ b/libjava/classpath/ChangeLog @@ -1,3 +1,12 @@ +2007-04-16 Andrew Haley <aph@redhat.com> + + * java/io/ObjectInputStream.java: (parseContent): Call (String, + Object) version of dumpElementln. + (dumpElementln(String, Object)): New method. + * java/io/ObjectOutputStream.java (writeObject): Call (String, + Object) version of dumpElementln. + (dumpElementln(String, Object)): New method. + 2007-04-16 Andrew John Hughes <gnu_andrew@member.fsf.org> * javax/management/ObjectName.java: diff --git a/libjava/classpath/java/io/ObjectInputStream.java b/libjava/classpath/java/io/ObjectInputStream.java index d6c1406..e469609 100644 --- a/libjava/classpath/java/io/ObjectInputStream.java +++ b/libjava/classpath/java/io/ObjectInputStream.java @@ -307,7 +307,7 @@ public class ObjectInputStream extends InputStream readArrayElements(array, componentType); if(dump) for (int i = 0, len = Array.getLength(array); i < len; i++) - dumpElementln(" ELEMENT[" + i + "]=" + Array.get(array, i)); + dumpElementln(" ELEMENT[" + i + "]=", Array.get(array, i)); ret_val = processResolution(null, array, handle); break; } @@ -1984,6 +1984,24 @@ public class ObjectInputStream extends InputStream System.out.print (Thread.currentThread() + ": "); } + private void dumpElementln (String msg, Object obj) + { + try + { + System.out.print(msg); + if (java.lang.reflect.Proxy.isProxyClass(obj.getClass())) + System.out.println(obj.getClass()); + else + System.out.println(obj); + } + catch (Exception _) + { + } + for (int i = 0; i < depth; i++) + System.out.print (" "); + System.out.print (Thread.currentThread() + ": "); + } + // used to keep a prioritized list of object validators private static final class ValidatorAndPriority implements Comparable { diff --git a/libjava/classpath/java/io/ObjectOutputStream.java b/libjava/classpath/java/io/ObjectOutputStream.java index c3c3df9..eac11f7 100644 --- a/libjava/classpath/java/io/ObjectOutputStream.java +++ b/libjava/classpath/java/io/ObjectOutputStream.java @@ -191,7 +191,7 @@ public class ObjectOutputStream extends OutputStream } if (dump) - dumpElementln ("WRITE: " + obj); + dumpElementln ("WRITE: ", obj); depth += 2; @@ -352,18 +352,18 @@ public class ObjectOutputStream extends OutputStream if (currentObjectStreamClass.hasWriteMethod()) { if (dump) - dumpElementln ("WRITE METHOD CALLED FOR: " + obj); + dumpElementln ("WRITE METHOD CALLED FOR: ", obj); setBlockDataMode(true); callWriteMethod(obj, currentObjectStreamClass); setBlockDataMode(false); realOutput.writeByte(TC_ENDBLOCKDATA); if (dump) - dumpElementln ("WRITE ENDBLOCKDATA FOR: " + obj); + dumpElementln ("WRITE ENDBLOCKDATA FOR: ", obj); } else { if (dump) - dumpElementln ("WRITE FIELDS CALLED FOR: " + obj); + dumpElementln ("WRITE FIELDS CALLED FOR: ", obj); writeFields(obj, currentObjectStreamClass); } } @@ -420,7 +420,7 @@ public class ObjectOutputStream extends OutputStream depth -= 2; if (dump) - dumpElementln ("END: " + obj); + dumpElementln ("END: ", obj); } } @@ -1340,6 +1340,28 @@ public class ObjectOutputStream extends OutputStream } } + private void dumpElementln (String msg, Object obj) + { + try + { + for (int i = 0; i < depth; i++) + System.out.print (" "); + System.out.print (Thread.currentThread() + ": "); + System.out.print (msg); + if (java.lang.reflect.Proxy.isProxyClass(obj.getClass())) + System.out.print (obj.getClass()); + else + System.out.print (obj); + } + catch (Exception _) + { + } + finally + { + System.out.println (); + } + } + private void dumpElementln (String msg) { for (int i = 0; i < depth; i++) |