Hi,
Mark Wielaard wrote:
Multiple nitpicks here. The comment "Can throw Errors and
RuntimeExceptions if caused by the readResolve() user code" should not
be here, but a comment of public Object readObject() method. (The fact
that SUN also does this is not really that relevant imho.) The name
'ignore' is really a misnomer now. Maybe it isn't really confusing, but
it looks funny.
Feel free to commit this with or without these nitpicks fixed.
Committed as follows:
2005-11-12 Wolfgang Baer <[EMAIL PROTECTED]>
* java/io/ObjectInputStream.java
(processResolution): Pass Error, RuntimeException and
ObjectStreamException through to the caller.
(readObject): Documentation update.
Regards,
Wolfgang
Index: java/io/ObjectInputStream.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/io/ObjectInputStream.java,v
retrieving revision 1.71
diff -u -r1.71 ObjectInputStream.java
--- java/io/ObjectInputStream.java 1 Nov 2005 23:32:21 -0000 1.71
+++ java/io/ObjectInputStream.java 12 Nov 2005 18:15:38 -0000
@@ -112,7 +112,10 @@
* <code>private void readObject (ObjectInputStream)</code>.
*
* If an exception is thrown from this method, the stream is left in
- * an undefined state.
+ * an undefined state. This method can also throw Errors and
+ * RuntimeExceptions if caused by existing readResolve() user code.
+ *
+ * @return The object read from the underlying stream.
*
* @exception ClassNotFoundException The class that an object being
* read in belongs to cannot be found.
@@ -1565,8 +1568,15 @@
catch (IllegalAccessException ignore)
{
}
- catch (InvocationTargetException ignore)
+ catch (InvocationTargetException exception)
{
+ Throwable cause = exception.getCause();
+ if (cause instanceof ObjectStreamException)
+ throw (ObjectStreamException) cause;
+ else if (cause instanceof RuntimeException)
+ throw (RuntimeException) cause;
+ else if (cause instanceof Error)
+ throw (Error) cause;
}
}
_______________________________________________
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches