RFR: 8328746: Remove unused imports in demo apps

Kevin Rushforth kcr at openjdk.org
Tue Mar 26 16:37:37 UTC 2024


On Thu, 21 Mar 2024 21:50:37 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

> Using Eclipse IDE to remove unused imports in **demo apps** (3D, Ensemble, etc.) and update the copyright year to 2024. Using wildcard for more than 10 static imports.
> 
> 
> --
> 
> This is a trivial change (though fairly large), 1 reviewer is probably enough.

Here is my $0.02 on the sorting of imports. I haven't cared enough before now to raise the issue, but since we are now going to be setting a precedent with these PRs, I want to codify the style guidelines. We should update the CONTRIBUTING guidelines to reflect whatever we decide. The current guidelines say this:

> Don't worry too much about import order. Try not to change it but don't worry about fighting your IDE to stop it from doing so.

We should replace this with the recommended sort order.

As for what that order should be, I have never much liked the idea of sorting or organizing imports into multiple groups with a set of rules that you have to remember / describe / teach your IDE about. The various IDEs or code-style guidelines with such conventions are often at odds with each other. Google used to have multiple groups (with rules about sorting the groups), but finally tired of this and changed to a simpler convention of having two groups: one for static imports (if any) and one for ordinary imports:

static imports (sorted alphabetically)
one blank line
ordinary imports (sorted alphabetically)

No wildcard imports (I favor an exception for static imports).

I propose that we do the same, but if someone has strong opinions otherwise, we can discuss.

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

PR Comment: https://git.openjdk.org/jfx/pull/1420#issuecomment-2020929321


More information about the openjfx-dev mailing list