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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user