[java-import] IDEA-368599 Skip unsupported import layout settings in formatter for future backward compatibility

GitOrigin-RevId: 8c42b236142ffea091cebb4f96d4443543646ba9
This commit is contained in:
Mikhail Pyltsin
2025-06-19 09:18:54 +00:00
committed by intellij-monorepo-bot
parent b86b3f5f01
commit ed99c0ab73
4 changed files with 82 additions and 24 deletions
@@ -1,7 +1,8 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.psi.codeStyle;
import com.intellij.application.options.codeStyle.properties.ValueListPropertyAccessor;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -64,6 +65,11 @@ public class JavaPackageEntryTableAccessor extends ValueListPropertyAccessor<Pac
}
}
else {
if (Registry.is("code.style.package.entry.table.check.compatibility", false)) {
if (!parseStr.isEmpty() && !Character.isJavaIdentifierStart(parseStr.charAt(0))) {
continue;
}
}
entryTable.addEntry(new PackageEntry(isStatic, parseStr, isWithSubpackages));
}
}