News for hackers. Stuff that matters.
Re:Java record pattern matching in JDK 19 by SemanticStrengh on Saturday May 14, 2022 @01:29PM (#31380262)
those cases are rare. Defensive copying should be optin, not the default. Java really deep copy objects for even the most basic instanceof checks??
Re:Java record pattern matching in JDK 19 by kaba0 on Saturday May 14, 2022 @02:48PM (#31381055)
You can’t change the object’s type in Java, so if you hold on to the same reference it will be safe to use after the instanceof check.