News for hackers. Stuff that matters.
Re: by marwis on Wednesday February 01, 2023 @07:20PM (#34620219)
But records don't actually offer such guarantees:

    record MutableRecord(ArrayList<String> list) {}
    
    var r = new MutableRecord(new ArrayList<>());
    System.out.println(r.hashCode()); // -> 1
    r.list().add("foo");
    System.out.println(r.hashCode()); // -> 101605

I sort of hoped they would freeze hashcode but they don't.

There are no comments on this comment yet.