refactor [java]: Private constructor for code server utils

GitOrigin-RevId: 80782884ecd167236af29a1c4a76a027e4e44628
This commit is contained in:
Bart van Helvert
2026-01-02 15:02:41 +00:00
committed by intellij-monorepo-bot
parent 7f800b0fb6
commit 69c5b75bd7
13 changed files with 23 additions and 1 deletions
@@ -15,6 +15,8 @@ import org.jetbrains.annotations.Nullable;
* Utility methods related to manifest declarations
*/
public final class JavaManifestUtil {
private JavaManifestUtil() { }
/**
* @param module module to find manifest in
* @param attribute attribute name from a manifest file
@@ -21,6 +21,8 @@ import static java.util.Objects.hash;
* Utilities related to the computation of pattern exhaustiveness
*/
public final class JavaPatternExhaustivenessUtil {
private JavaPatternExhaustivenessUtil() { }
private static final Logger LOG = Logger.getInstance(JavaPatternExhaustivenessUtil.class);
//it is approximately equals max method size * 10
private static final int MAX_ITERATION_COVERAGE = 5_000;
@@ -19,6 +19,8 @@ import static java.util.Objects.requireNonNullElse;
* Utilities to support Java preview feature highlighting
*/
public final class JavaPreviewFeatureUtil {
private JavaPreviewFeatureUtil() { }
/**
* Internal JDK annotation for preview feature APIs
*/
@@ -15,6 +15,8 @@ import java.lang.annotation.RetentionPolicy;
* Utility methods related to {@link PsiAnnotation}.
*/
public final class JavaPsiAnnotationUtil {
private JavaPsiAnnotationUtil() { }
/**
* @param annotation annotation class
* @return annotation retention policy; null if cannot be determined
@@ -13,6 +13,8 @@ import org.jetbrains.annotations.Nullable;
* Utility methods related to Java enums
*/
public final class JavaPsiEnumUtil {
private JavaPsiEnumUtil() { }
/**
* @param field field to check
* @param enumClass an enum class returned from {@link #getEnumClassForExpressionInInitializer(PsiExpression)}
@@ -20,6 +20,8 @@ import static java.util.Objects.requireNonNull;
* Utilities related to Java methods
*/
public final class JavaPsiMethodUtil {
private JavaPsiMethodUtil() { }
/**
* @param aClass class to analyze
* @param overrideEquivalentSuperMethods collection of override-equivalent super methods
@@ -18,6 +18,7 @@ import java.util.Set;
* @see PsiModifierList
*/
public final class JavaPsiModifierUtil {
private JavaPsiModifierUtil() { }
private static final Map<String, Set<String>> ourInterfaceIncompatibleModifiers = Map.of(
PsiModifier.ABSTRACT, Set.of(),
@@ -48,6 +48,8 @@ import static java.util.Objects.requireNonNullElse;
* Utilities related to JPMS modules
*/
public final class JavaPsiModuleUtil {
private JavaPsiModuleUtil() { }
/**
* @param element PSI element that belongs to the module
* @return JPMS module the supplied element belongs to; null if no module definition is found
@@ -17,6 +17,8 @@ import static com.intellij.psi.PsiModifier.SEALED;
* Utility methods related to sealed types
*/
public final class JavaPsiSealedUtil {
private JavaPsiSealedUtil() { }
/**
* @param psiClass class to check
* @return true if the class is abstract and sealed
@@ -13,6 +13,8 @@ import java.io.IOException;
* Utilities related to single-file Java programs (JEP 330)
*/
public final class JavaPsiSingleFileSourceUtil {
private JavaPsiSingleFileSourceUtil() { }
/**
* @return true if file correspond to the shebang script
*/
@@ -23,7 +23,7 @@ import static java.util.Objects.requireNonNull;
* Utility methods to support switch
*/
public final class JavaPsiSwitchUtil {
private JavaPsiSwitchUtil() { }
/**
* Returns the selector kind based on the type.
@@ -18,6 +18,7 @@ import java.util.Objects;
* Utility methods related to variables
*/
public final class JavaPsiVariableUtil {
private JavaPsiVariableUtil() { }
private static PsiVariable findSameNameSibling(@NotNull PsiVariable variable) {
PsiElement scope = variable.getParent();
@@ -14,6 +14,8 @@ import java.util.Set;
* Utility for working with Java services (jigsaw)
*/
public final class JavaServiceProviderUtil {
private JavaServiceProviderUtil() { }
public static final String PROVIDER = "provider";
public static final Set<String> JAVA_UTIL_SERVICE_LOADER_METHODS = Set.of("load", "loadInstalled");