Class.hashCode() broken?

Jeff Sturm jsturm@sigma6.com
Fri Jun 25 11:37:00 GMT 1999


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


More information about the Java mailing list