@Nullable
  @Override
  public String getErrorMessage(@NotNull String newName, @NotNull Project project) {
    if (FileTypeManager.getInstance().isFileIgnored(newName)) {
      return JavaBundle.message("rename.package.ignored.name.warning");
    }

    if (newName.length() > 0) {
      if (!PsiDirectoryFactory.getInstance(project).isValidPackageName(newName)) {
        return JavaBundle.message("rename.package.invalid.name.error");
      }
    }

    return null;
  }
@Nullable
  @Override
  public String getErrorMessage(@NotNull String newName, @NotNull Project project)