Java import ordering

Antonin has proposed changing the package naming from to org.openrefine when we do the next breaking (ie backward incompatible) release. I think that makes sense if we're going to be updating the extension interface and public APIs anyway.

Since we'll be doing wholesale edits of import statements anway, it'd also be a good time to make any updates to the ordering of import statements. The standard that we currently use is pretty much based on the Apache model: java, javax, all non-project imports, project imports (although it looks like we have a slight variation for the third category where we include separately before com.*. Static imports weren't a thing back in 2010, but it makes sense to import them first since that's what most folks do.

Google's standard is the utmost in simplicity with just two blocks: static & non-static with a single blank line separating the two.

IntelliJ has a threshold (5 default) where it switches to wildcard imports, but Google disallows wildcard imports. IntelliJ also lets you always use wildcards for certain packages (e.g. java.awt.*). Since we rarely have high number of import statements, I think we can just stick with Google's "no wildcard imports" rule.

What do others think? Although sticking with something close to our current standard will minimize noise in the diff, it doesn't make a huge difference given the volume of other changes, so if folks really want to go with the Google scheme or something else we can.


I don't have strong feelings about import ordering, but I am generally keen to normalize those via a linter. I am not sure if the one we currently use supports that though.