diff --git a/idea_plugin/src/main/java/com/google/googlejavaformat/intellij/InitialConfigurationStartupActivity.java b/idea_plugin/src/main/java/com/google/googlejavaformat/intellij/InitialConfigurationStartupActivity.java index 940def655..95e13d325 100644 --- a/idea_plugin/src/main/java/com/google/googlejavaformat/intellij/InitialConfigurationStartupActivity.java +++ b/idea_plugin/src/main/java/com/google/googlejavaformat/intellij/InitialConfigurationStartupActivity.java @@ -27,8 +27,6 @@ final class InitialConfigurationStartupActivity implements StartupActivity.Background { private static final String NOTIFICATION_TITLE = "Enable google-java-format"; - private static final NotificationGroup NOTIFICATION_GROUP = - NotificationGroupManager.getInstance().getNotificationGroup(NOTIFICATION_TITLE); @Override public void runActivity(@NotNull Project project) { @@ -43,9 +41,11 @@ public void runActivity(@NotNull Project project) { } private void displayNewUserNotification(Project project, GoogleJavaFormatSettings settings) { + NotificationGroupManager groupManager = NotificationGroupManager.getInstance(); + NotificationGroup group = groupManager.getNotificationGroup(NOTIFICATION_TITLE); Notification notification = new Notification( - NOTIFICATION_GROUP.getDisplayId(), + group.getDisplayId(), NOTIFICATION_TITLE, "The google-java-format plugin is disabled by default. " + "Enable for this project.",