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:
Tom Tromey
2003-08-01 03:34:52 +00:00
committed by Tom Tromey
parent e14c33e5af
commit e9c00e62d0
3 changed files with 58 additions and 23 deletions
+12 -5
View File
@@ -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;
}
}