Hacker News new | ask | show | jobs
by DarkNova6 796 days ago
As far as I know `footGunA` can only be a static method and cannot leak `this`.

This is perfectly fine as far as I'm concerned.

1 comments

I should have checked instead of replying from memory: It's actually footgunB that is refused by the compiler. footgunA is accepted and will even call happily into an overridden implementation from a field initializer in the superclass. That way you can get a method to see a final field null on one call and non-null on the next.