This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libgcj/11728] New: HashMap serialization does not work


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11728

           Summary: HashMap serialization does not work
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcj
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: yozh at mx1 dot ru
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i386-pc-linux-gnu
  GCC host triplet: i386-pc-linux-gnu
GCC target triplet: i386-pc-linux-gnu


Library serialize class HashMap incorrectly -- it reads empty map from stream.

Environment:
System: Linux banana.mx1.ru 2.4.18 #3 Thu Jun 27 17:31:10 UTC 2002 i686 GNU/Linux
Architecture: i686

	
host: i386-pc-linux-gnu
build: i386-pc-linux-gnu
target: i386-pc-linux-gnu
configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i386-linux

How-To-Repeat:

Source code:

===
import java.io.*;
import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception {
		ObjectOutputStream oo =
				new ObjectOutputStream(new FileOutputStream("1"));
		Map m = new HashMap();
		m.put("12", "13");
		m.put("45", "67");
		System.out.println(m);
		oo.writeObject(m);
		oo.close();
		
		ObjectInputStream ii =
				new ObjectInputStream(new FileInputStream("1"));
		Object n = ii.readObject();
		System.out.println(n);
	}
}
===

Prints 

{12=13, 45=67}
{}

when invoking class with gij or after compiling with gcj, on Linux and FreeBSD.
It should print

{12=13, 45=67}
{12=13, 45=67}

this is output of Sun's Java.
------- Additional Comments From yozh at mx1 dot ru  2003-07-30 16:57 -------
Fix:

I don't know.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]