#704 ImportOrder should ignore grouping order in static group

release_5.0
closed
nobody
None
1
2014-08-22
2013-08-16
David Harkness
No

When you specify package groupings inside ImportOrder, that same ordering is applied to the single group of static imports. Eclipse's Organize Imports feature, however, sorts all static imports alphabetically within a single group--ignoring the package grouping order. There's no way to synchronize the behavior between the two tools.

For example, using "org,java" produces this in Eclipse:

import static java.Math.abs;
import static org.foo.Bar.*;

import org.foo.Foo;

import java.util.Set;

For maximum flexibility, add an option to control whether or not the static imports (when grouped using "top" and "bottom" option) are sorted normally or according to the package groupings.

Discussion

  • David Harkness
    David Harkness
    2013-08-16

    Or perhaps it wants the two static imports above to be separated into groups as well. I cannot tell from the error message.

     
  • Roman Ivanov
    Roman Ivanov
    2013-10-05

    • status: open --> closed