Incident Report 9079511: Java Language Enhancement: Disallow access to static members via object references

Brian Goetz brian.goetz at oracle.com
Fri Jan 23 17:40:25 UTC 2026


>> This is an easy call. The answer is that it's not worth changing
>> because this would cause legacy to to start failing
>> ...
>> and there is already a perfectly reasonable workaround.
> I agree. I do think it's worth issuing warnings _by default_, and
> turning this into _opt-out_ rather than _opt-in_.

It's easy to have this opinion for any given warning; for every warning, 
there is _someone_ who thinks it should be turned up (if not all the way 
to error.)   But these decisions need to be made within a more coherent 
strategy than "this bug pattern really bugs me".  Otherwise, we set 
`javac` on a path where its secondary mission is to be a mediocre static 
analysis engine.  Our preference is to leave that to tools whose 
_primary_ mission is static analysis -- of which there are many, and 
they are all going to be much better at it than `javac`, because `javac` 
has a different primary mission.


More information about the amber-dev mailing list