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

Tagir Valeev amaembo at gmail.com
Sat Jan 24 13:18:26 UTC 2026


Hi!

On Sat, Jan 24, 2026, 14:09 Attila Kelemen <attila.kelemen85 at gmail.com>
wrote:

> My $0.02: This is an easy call. The answer is that it's not worth changing
>> because (b) this would cause legacy to to start failing to compile, which
>> is violates Java's stellar reputation for backward compatibility, and (b)
>> there is already a perfectly reasonable workaround, i.e. -Xlint:static
>> -Werror.
>>
>
> I'm not arguing that the original request should be implemented and break
> existing code (bad as they are). However, this suggestion doesn't really
> work, because javac doesn't support different sets of values for `Werror`
> and for mere warnings. That is, I usually want to turn on almost everything
> for `Xlint` , but I definitely don't want every warning to be an error
> (most notably, I don't want `@deprecated` to immediately fail compilation,
> but I want it to be reported as a warning).
>

Exactly my thoughts.

With best regards,
Tagir Valeev

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20260124/936dda0c/attachment.htm>


More information about the amber-dev mailing list