Is it possible to change the order of static imports followed by imports in eclipse?

Viewed 1082

By default, when you use the ctrl + shift + o shortcut, the static imports are placed before the standard imports

import static org.mockito.Maters.any;
import static org.mockito.Maters.anyInt;
import static org.mockito.Maters.anyString;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

Unfortunately, this is against our company's internal code checkstyle, is it possible to change this grouping so the static imports come after the standard imports?

2 Answers

I have found one solution. Change the file .settings/org.eclipse.jdt.ui.prefs and put new line:

    org.eclipse.jdt.ui.importorder=com;java;javax;org;;\#;

And you will have:
java.*
javax.*
org.*
<others>
import static *

Related