@Nullable
  private static HighlightInfo.Builder createInfoAndRegisterRenameFix(@NotNull PsiClass aClass,
                                                              @NotNull String name,
                                                              @NotNull @PropertyKey(resourceBundle = JavaErrorBundle.BUNDLE) String key) {
    String message = JavaErrorBundle.message(key, name);
    PsiIdentifier identifier = aClass.getNameIdentifier();
    HighlightInfo.Builder info;
    if (aClass instanceof PsiImplicitClass) {
      info = HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR)
        .range(aClass)
        .fileLevelAnnotation()
        .description(message);
      IntentionAction action = QuickFixFactory.getInstance().createRenameFix(aClass);
      if (action != null) {
        info.registerFix(action, null, null, null, null);
      }
    }
    else {
      if (identifier == null) return null;
      TextRange textRange = identifier.getTextRange();
      info = HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR)
        .range(textRange)
        .descriptionAndTooltip(message);
      IntentionAction action = QuickFixFactory.getInstance().createRenameFix(identifier);
      if (action != null) {
        info.registerFix(action, null, null, null, null);
      }
    }
    return info;
  }
@Nullable
  private static HighlightInfo.Builder createInfoAndRegisterRenameFix(@NotNull PsiClass aClass,
                                                              @NotNull String name,
                                                              @NotNull @PropertyKey(resourceBundle = JavaErrorBundle.BUNDLE) String key)