private @Nullable @InspectionMessage String getIdentifierWarning(PsiIdentifier identifier) {
        String name = identifier.getText();
        PsiElement parent = identifier.getParent();
        JavaFeature feature = PsiUtil.softKeywordFeature(name);
        if (feature != null && 
            feature != JavaFeature.MODULES && !name.equals(PsiKeyword.WHEN) && // Keywords from module-info and 'when' still can be used as class names
            !feature.isSufficient(languageLevel) && parent instanceof PsiClass) {
          return JavaErrorBundle.message("restricted.identifier.warn", name,
                                         feature.getMinimumLevel().feature());
        }
        switch (name) {
          case PsiKeyword.ASSERT -> {
            if (!JavaFeature.ASSERTIONS.isSufficient(languageLevel) &&
                (parent instanceof PsiClass || parent instanceof PsiMethod || parent instanceof PsiVariable)) {
              return JavaErrorBundle.message("assert.identifier.warn");
            }
          }
          case PsiKeyword.ENUM -> {
            if (!JavaFeature.ENUMS.isSufficient(languageLevel) &&
                (parent instanceof PsiClass || parent instanceof PsiMethod || parent instanceof PsiVariable)) {
              return JavaErrorBundle.message("enum.identifier.warn");
            }
          }
          case "_" -> {
            if (languageLevel.isLessThan(LanguageLevel.JDK_1_9)) {
              return JavaErrorBundle.message("underscore.identifier.warn");
            }
          }
        }
        return null;
      }
private @Nullable @InspectionMessage String getIdentifierWarning(PsiIdentifier identifier)