Skip to content

Commit 5866980

Browse files
committed
Load services outside of constructors and class initializers
1 parent b3c7c11 commit 5866980

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

idea_plugin/src/main/java/com/google/googlejavaformat/intellij/InitialConfigurationStartupActivity.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
final class InitialConfigurationStartupActivity implements StartupActivity.Background {
2828

2929
private static final String NOTIFICATION_TITLE = "Enable google-java-format";
30-
private static final NotificationGroup NOTIFICATION_GROUP =
31-
NotificationGroupManager.getInstance().getNotificationGroup(NOTIFICATION_TITLE);
3230

3331
@Override
3432
public void runActivity(@NotNull Project project) {
@@ -43,9 +41,11 @@ public void runActivity(@NotNull Project project) {
4341
}
4442

4543
private void displayNewUserNotification(Project project, GoogleJavaFormatSettings settings) {
44+
NotificationGroupManager groupManager = NotificationGroupManager.getInstance();
45+
NotificationGroup group = groupManager.getNotificationGroup(NOTIFICATION_TITLE);
4646
Notification notification =
4747
new Notification(
48-
NOTIFICATION_GROUP.getDisplayId(),
48+
group.getDisplayId(),
4949
NOTIFICATION_TITLE,
5050
"The google-java-format plugin is disabled by default. "
5151
+ "<a href=\"enable\">Enable for this project</a>.",

0 commit comments

Comments
 (0)