RFR: JDK-8297332: Remove easy warnings in base

Andy Goryachev angorya at openjdk.org
Mon Nov 21 17:01:33 UTC 2022


On Mon, 21 Nov 2022 11:53:30 GMT, John Hendrikx <jhendrikx at openjdk.org> wrote:

> - Remove unsupported/unnecessary SuppressWarning annotations
> - Remove reduntant type specifications (use diamond operator)
> - Remove unused or duplicate imports
> - Remove unnecessary casts (type is already correct type or can be autoboxed)
> - Remove unnecessary semi-colons (at end of class definitions, or just repeated ones)
> - Remove redundant super interfaces (interface that is already inherited)
> - Remove unused type parameters
> - Remove declared checked exceptions that are never thrown
> - Add missing `@Override` annotations

One suggestion I'd like to make is to publish the Compiler Errors/Warnings configuration for Eclipse.  I have a set of screenshots that produce a 0 err/warn count with the current master.  Eclipse also seem to provide a way to export/import these configs, but for some reason export/import stopped working for me around a decade ago.

I also noticed two things in general:
1. the default err/warn configuration enables meaningless warnings and disables those that point to the real problems (see [JDK-8289379](https://bugs.openjdk.org/browse/JDK-8289379))
2. in large code bases with multiple contributors, it makes little sense to enable warnings like usage of raw type or unused imports since they a) don't contribute to code quality and b) are getting re-introduced all the time by people who don't use Eclipse

I am giving just two examples, but there are a few other warnings that I think should be disabled.

It does not mean we should not attempt to clean up the code base, but at some point the benefit-to-cost ratio is just not that great.

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

PR: https://git.openjdk.org/jfx/pull/957


More information about the openjfx-dev mailing list