summaryrefslogtreecommitdiffstats
path: root/libjava/java/io
diff options
context:
space:
mode:
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2003-09-25 19:06:20 +0000
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2003-09-25 19:06:20 +0000
commit9a3c950d253d62eca792d54a4a203b93c231e95a (patch)
tree14db075ac6662fd4ce88400d152bb15cf0bcca79 /libjava/java/io
parentcabf12049ca360553f148163e9e13aacdd7f5e7d (diff)
downloadppe42-gcc-9a3c950d253d62eca792d54a4a203b93c231e95a.tar.gz
ppe42-gcc-9a3c950d253d62eca792d54a4a203b93c231e95a.zip
2003-09-25 Ingo Proetel <proetel@aicas.com>
* java/io/ObjectOutputStream.java: Allow putFields be called more than once. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71791 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/io')
-rw-r--r--libjava/java/io/ObjectOutputStream.java32
1 files changed, 19 insertions, 13 deletions
diff --git a/libjava/java/io/ObjectOutputStream.java b/libjava/java/io/ObjectOutputStream.java
index 1437a4f6918..3e47e70671f 100644
--- a/libjava/java/io/ObjectOutputStream.java
+++ b/libjava/java/io/ObjectOutputStream.java
@@ -361,7 +361,7 @@ public class ObjectOutputStream extends OutputStream
}
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 @@ public class ObjectOutputStream extends OutputStream
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 class ObjectOutputStream extends OutputStream
public PutField putFields () throws IOException
{
- markFieldsWritten ();
-
+ if (currentPutField == null)
+ {
currentPutField = new PutField ()
{
private byte[] prim_field_data
@@ -1002,6 +1002,7 @@ public class ObjectOutputStream extends OutputStream
}
};
// end PutFieldImpl
+ }
return currentPutField;
}
@@ -1012,7 +1013,12 @@ public class ObjectOutputStream extends OutputStream
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 @@ public class ObjectOutputStream extends OutputStream
}
catch (Exception _)
{
- throw new IOException ();
+ throw new IOException ("Unexpected Exception "+_);
}
}
@@ -1263,7 +1269,7 @@ public class ObjectOutputStream extends OutputStream
}
catch (Exception _)
{
- throw new IOException ();
+ throw new IOException ("Unexpected Exception "+_);
}
}
@@ -1278,7 +1284,7 @@ public class ObjectOutputStream extends OutputStream
}
catch (Exception _)
{
- throw new IOException ();
+ throw new IOException ("Unexpected Exception "+_);
}
}
@@ -1293,7 +1299,7 @@ public class ObjectOutputStream extends OutputStream
}
catch (Exception _)
{
- throw new IOException ();
+ throw new IOException ("Unexpected Exception "+_);
}
}
@@ -1308,7 +1314,7 @@ public class ObjectOutputStream extends OutputStream
}
catch (Exception _)
{
- throw new IOException ();
+ throw new IOException ("Unexpected Exception "+_);
}
}
@@ -1323,7 +1329,7 @@ public class ObjectOutputStream extends OutputStream
}
catch (Exception _)
{
- throw new IOException ();
+ throw new IOException ("Unexpected Exception "+_);
}
}
@@ -1338,7 +1344,7 @@ public class ObjectOutputStream extends OutputStream
}
catch (Exception _)
{
- throw new IOException ();
+ throw new IOException ("Unexpected Exception "+_);
}
}
@@ -1353,7 +1359,7 @@ public class ObjectOutputStream extends OutputStream
}
catch (Exception _)
{
- throw new IOException ();
+ throw new IOException ("Unexpected Exception "+_);
}
}
@@ -1369,7 +1375,7 @@ public class ObjectOutputStream extends OutputStream
}
catch (Exception _)
{
- throw new IOException ();
+ throw new IOException ("Unexpected Exception "+_);
}
}
OpenPOWER on IntegriCloud