aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/io/ObjectOutputStream.java
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2003-08-01 03:34:52 +0000
committerTom Tromey <tromey@gcc.gnu.org>2003-08-01 03:34:52 +0000
commite9c00e62d0aa1448248d377d82eb1b186152a061 (patch)
tree2c95f8943b3e378b8ac84603e28841387ef9467d /libjava/java/io/ObjectOutputStream.java
parente14c33e5afb8977784f2fbf1c896e130c14282fb (diff)
downloadgcc-e9c00e62d0aa1448248d377d82eb1b186152a061.zip
gcc-e9c00e62d0aa1448248d377d82eb1b186152a061.tar.gz
gcc-e9c00e62d0aa1448248d377d82eb1b186152a061.tar.bz2
More for PR libgcj/11737:
* java/io/ObjectInputStream.java (processResolution): Use getMethod. (getMethod): Make method accessible. (getField): Make field accessible. (setBooleanField): Don't call setAccessible here. (setByteField, setCharField, setDoubleField, setFloatField, setIntField, setLongField, setShortField, setObjectField): Likewise. (callReadMethod): Don't check whether method is null. Catch NoSuchMethodException. * java/io/ObjectOutputStream.java (callWriteMethod): Initialize cause on thrown exceptions. From-SVN: r70038
Diffstat (limited to 'libjava/java/io/ObjectOutputStream.java')
-rw-r--r--libjava/java/io/ObjectOutputStream.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/libjava/java/io/ObjectOutputStream.java b/libjava/java/io/ObjectOutputStream.java
index 49cb636..1437a4f 100644
--- a/libjava/java/io/ObjectOutputStream.java
+++ b/libjava/java/io/ObjectOutputStream.java
@@ -1197,7 +1197,8 @@ public class ObjectOutputStream extends OutputStream
}
- private void callWriteMethod (Object obj, ObjectStreamClass osc) throws IOException
+ private void callWriteMethod (Object obj, ObjectStreamClass osc)
+ throws IOException
{
Class klass = osc.forClass();
try
@@ -1220,13 +1221,19 @@ public class ObjectOutputStream extends OutputStream
if (exception instanceof IOException)
throw (IOException) exception;
- throw new IOException ("Exception thrown from writeObject() on " +
- klass + ": " + exception.getClass().getName());
+ IOException ioe
+ = new IOException ("Exception thrown from writeObject() on " +
+ klass + ": " + exception.getClass().getName());
+ ioe.initCause(exception);
+ throw ioe;
}
catch (Exception x)
{
- throw new IOException ("Failure invoking writeObject() on " +
- klass + ": " + x.getClass().getName());
+ IOException ioe
+ = new IOException ("Failure invoking writeObject() on " +
+ klass + ": " + x.getClass().getName());
+ ioe.initCause(x);
+ throw ioe;
}
}