[java-imports] IDEA-368382 incorrect place for module import

- support static separately


(cherry picked from commit 8d1acc0e8d2bd7d60b1f03b1ebe367d7d9f2e2a9)

IJ-CR-156496

GitOrigin-RevId: d109ac92ad1c67ef65b4267cc752475b98fa267e
This commit is contained in:
Mikhail Pyltsin
2025-03-01 16:39:10 +01:00
committed by intellij-monorepo-bot
parent f99f182609
commit f82340ac1c
3 changed files with 35 additions and 1 deletions

View File

@@ -254,6 +254,23 @@ public class JavaCodeStyleSettingsTest extends CodeStyleTestCase {
assertEquals(PackageEntry.ALL_OTHER_IMPORTS_ENTRY, table.getEntryAt(7));
}
public void testWithoutStaticImportWithoutModuleAndStaticNotSeparate() throws SchemeImportException {
CodeStyleSettings settings = importSettings();
JavaCodeStyleSettings customSettings = settings.getCustomSettings(JavaCodeStyleSettings.class);
PackageEntryTable table = customSettings.IMPORT_LAYOUT_TABLE;
assertSize(7, table.getEntries());
assertEquals(PackageEntry.ALL_MODULE_IMPORTS, table.getEntryAt(0));
assertEquals(PackageEntry.BLANK_LINE_ENTRY, table.getEntryAt(1));
assertEquals(PackageEntry.BLANK_LINE_ENTRY, table.getEntryAt(2));
assertEquals("javax", table.getEntryAt(3).getPackageName());
assertEquals("java", table.getEntryAt(4).getPackageName());
assertEquals(PackageEntry.BLANK_LINE_ENTRY, table.getEntryAt(5));
assertEquals(PackageEntry.ALL_OTHER_IMPORTS_ENTRY, table.getEntryAt(6));
}
public void testEmptyConfigImport() throws SchemeImportException {
CodeStyleSettings settings = importSettings();