This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
Class.hashCode() broken?
- To: java-discuss@sourceware.cygnus.com
- Subject: Class.hashCode() broken?
- From: Jeff Sturm <jsturm@sigma6.com>
- Date: Fri, 25 Jun 1999 14:38:36 -0400
- Organization: AppNet Systems Inc.
public class HashTest {
public static void main(String[] args) {
HashTest ht = new HashTest();
System.err.println(ht.hashCode());
System.err.println(ht.getClass().hashCode());
}
}
gives me:
134770680
Aborted
gdb says:
Program received signal SIGSEGV, Segmentation fault.
0x0 in ?? ()
(gdb) bt
#0 0x0 in ??()
#1 0x804ad4f in HashTest.main (args=0x806eff0) at
HashTest.java:6
Weird... hashCode() works in java.lang.Object, but fails in
java.lang.Class, which inherits from Object and does not override
hashCode().
--
Jeff Sturm
jsturm@sigma6.com