This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
FYI: Patch: java.io.ObjectOutputStream
- From: Michael Koch <konqueror at gmx dot de>
- To: java-patches at gcc dot gnu dot org
- Date: Thu, 25 Sep 2003 21:08:36 +0200
- Subject: FYI: Patch: java.io.ObjectOutputStream
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi list,
I commited the attached patch to trunk to merge
java.io.ObjectOutputStream with classpath again.
Michael
- --
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQE/cz00WSOgCCdjSDsRAgSmAKCNQ+SED3tY7DvMOEnPVXJ9HlkpWQCeI6lm
kRpFZRTw6JDYIBZ1NJVTY5k=
=IZk0
-----END PGP SIGNATURE-----
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.2186
diff -u -b -B -r1.2186 ChangeLog
--- ChangeLog 25 Sep 2003 18:31:48 -0000 1.2186
+++ ChangeLog 25 Sep 2003 19:04:30 -0000
@@ -1,3 +1,8 @@
+2003-09-25 Ingo Proetel <proetel@aicas.com>
+
+ * java/io/ObjectOutputStream.java:
+ Allow putFields be called more than once.
+
2003-09-25 Sascha Brawer <brawer@dandelis.ch>
* java/awt/image/Raster.java(Raster): Interpret null origin as (0,0).
Index: java/io/ObjectOutputStream.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/io/ObjectOutputStream.java,v
retrieving revision 1.19
diff -u -b -B -r1.19 ObjectOutputStream.java
--- java/io/ObjectOutputStream.java 1 Aug 2003 03:34:52 -0000 1.19
+++ java/io/ObjectOutputStream.java 25 Sep 2003 19:04:30 -0000
@@ -361,7 +361,7 @@
}
catch (IOException ioe)
{
- throw new StreamCorruptedException ("Exception " + ioe + " thrown while exception was being written to stream.");
+ throw new StreamCorruptedException ("Exception " + ioe + " thrown while exception ("+e+") was being written to stream.");
}
reset (true);
@@ -443,7 +443,7 @@
throw new NotActiveException ("defaultWriteObject called by non-active class and/or object");
if (fieldsAlreadyWritten)
- throw new IOException ("Only one of putFields and defaultWriteObject may be called, and it may only be called once");
+ throw new IOException ("Only one of writeFields and defaultWriteObject may be called, and it may only be called once");
fieldsAlreadyWritten = true;
}
@@ -866,8 +866,8 @@
public PutField putFields () throws IOException
{
- markFieldsWritten ();
-
+ if (currentPutField == null)
+ {
currentPutField = new PutField ()
{
private byte[] prim_field_data
@@ -1002,6 +1002,7 @@
}
};
// end PutFieldImpl
+ }
return currentPutField;
}
@@ -1012,7 +1013,12 @@
if (currentPutField == null)
throw new NotActiveException ("writeFields can only be called after putFields has been called");
+ // moved here from putFields since putFields
+ // may be called more than once, but not writeFields
+ markFieldsWritten();
+
currentPutField.write (this);
+ currentPutField = null;
}
@@ -1248,7 +1254,7 @@
}
catch (Exception _)
{
- throw new IOException ();
+ throw new IOException ("Unexpected Exception "+_);
}
}
@@ -1263,7 +1269,7 @@
}
catch (Exception _)
{
- throw new IOException ();
+ throw new IOException ("Unexpected Exception "+_);
}
}
@@ -1278,7 +1284,7 @@
}
catch (Exception _)
{
- throw new IOException ();
+ throw new IOException ("Unexpected Exception "+_);
}
}
@@ -1293,7 +1299,7 @@
}
catch (Exception _)
{
- throw new IOException ();
+ throw new IOException ("Unexpected Exception "+_);
}
}
@@ -1308,7 +1314,7 @@
}
catch (Exception _)
{
- throw new IOException ();
+ throw new IOException ("Unexpected Exception "+_);
}
}
@@ -1323,7 +1329,7 @@
}
catch (Exception _)
{
- throw new IOException ();
+ throw new IOException ("Unexpected Exception "+_);
}
}
@@ -1338,7 +1344,7 @@
}
catch (Exception _)
{
- throw new IOException ();
+ throw new IOException ("Unexpected Exception "+_);
}
}
@@ -1353,7 +1359,7 @@
}
catch (Exception _)
{
- throw new IOException ();
+ throw new IOException ("Unexpected Exception "+_);
}
}
@@ -1369,7 +1375,7 @@
}
catch (Exception _)
{
- throw new IOException ();
+ throw new IOException ("Unexpected Exception "+_);
}
}