logoalt Hacker News

cogman10yesterday at 8:09 PM1 replyview on HN

It won't bite initially, it will bite when you go to update your version of javac in the future and this becomes the default. Or when you update a library that just so happened to be compiled with a newer version of javac.

This particularly matters when you have something likes this

    class Local {
       private final ThirdPartyObject tpo;
    }
or even something like this

    class Local {
      private final LocalDate ld;
    }

Replies

vips7Lyesterday at 8:31 PM

Extremely easy to fix. Turn it into a record. I’m also pretty sure that cracking final fields is already disabled by default.

show 1 reply