This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
libgcj/9913: Deserializing a java.util.Vector fails
- From: gcj at shawn-walker dot net
- To: gcc-gnats at gcc dot gnu dot org
- Date: 3 Mar 2003 06:41:20 -0000
- Subject: libgcj/9913: Deserializing a java.util.Vector fails
- Reply-to: gcj at shawn-walker dot net
>Number: 9913
>Category: libgcj
>Synopsis: Deserializing a java.util.Vector fails
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Mar 03 06:46:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Shawn Walker
>Release: gcj-3.2.2 (Debian prerelease)
>Organization:
>Environment:
Linux SpeedDemon 2.4.20 #2 Tue Jan 14 21:23:42 EST 2003 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz GenuineIntel GNU/Linux
>Description:
When serializing, and then deserializing a Vector, a NullPointerException is thrown. The following is a fairly short example:
import java.io.*;
import java.util.*;
public class ST {
public static final void main(String[] args) {
Vector v=new Vector();
FileOutputStream output;
ObjectOutputStream oos;
try {
output=new FileOutputStream("testfile");
oos=new ObjectOutputStream(output);
oos.writeObject(v);
oos.close();
} catch (IOException e) {}
FileInputStream input;
ObjectInputStream ois;
try {
input=new FileInputStream("testfile");
ois=new ObjectInputStream(input);
v=(Vector)ois.readObject();
ois.close();
} catch (IOException e) {}
catch (ClassNotFoundException e) {}
}
}
>How-To-Repeat:
>Fix:
Unknown
>Release-Note:
>Audit-Trail:
>Unformatted: