On Thu, 12 Jun 2025 21:25:42 GMT, Phil Race <p...@openjdk.org> wrote:

>> src/java.desktop/share/classes/javax/swing/SwingUtilities.java line 1656:
>> 
>>> 1654:      * @return the first ancestor of c that's a Window
>>> 1655:      */
>>> 1656:     @SuppressWarnings("removal")
>> 
>> @SuppressWarnings("removal") can be deleted?
>
> That's a very good point. I had forgotten that the JDK build does not warn 
> about *unneeded* suppressions. Only missing ones. And all those little 
> instanceof checks means there's a bunch of them. I'll try to spot them all.

I wish there were a way to do that, but I can't see how that could be done. At 
the core of the problem lies the fact that the specification of 
`@SuppressWarnings` does not specify what you can give as strings, and 
different compilers can behave differently and have any arbitrary strings. So 
javac cannot say "this string is invalid" or "this warning does not apply here 
so nothing is suppressed". Or, well, it *could* do but that but then it would 
complain on code that is "technically" correct. I don't think I'd be very 
successful in persuading the langtools team to do that.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25698#discussion_r2145147941

Reply via email to