mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
[java] Do not access application service from class init of InferNullityAnnotationsAction
GitOrigin-RevId: 6715ca73262ab8a950c236cb8410ed443acfda35
This commit is contained in:
committed by
intellij-monorepo-bot
parent
4e1dd1e796
commit
bf9dc8bef2
@@ -67,9 +67,6 @@ public class InferNullityAnnotationsAction extends BaseAnalysisAction {
|
||||
private static final String SUGGEST_ANNOTATION_DEPENDENCY = "java.suggest.annotation.dependency";
|
||||
private static final @NonNls String ANNOTATE_LOCAL_VARIABLES = "checkbox.annotate.local.variables";
|
||||
private InferNullityAdditionalUi myUi;
|
||||
private static final NotificationGroup NOTIFICATION_GROUP = NotificationGroupManager
|
||||
.getInstance()
|
||||
.getNotificationGroup("Infer Nullity");
|
||||
|
||||
public InferNullityAnnotationsAction() {
|
||||
super(JavaBundle.messagePointer("dialog.title.infer.nullity"), JavaBundle.messagePointer("action.title.infer.nullity.annotations"));
|
||||
@@ -287,8 +284,8 @@ public class InferNullityAnnotationsAction extends BaseAnalysisAction {
|
||||
if (command.myCount == 0) {
|
||||
NullityInferrer.nothingFoundMessage(project);
|
||||
} else {
|
||||
NOTIFICATION_GROUP.createNotification(JavaBundle.message("notification.content.added.annotations", command.myCount),
|
||||
NotificationType.INFORMATION)
|
||||
getNotificationGroup().createNotification(JavaBundle.message("notification.content.added.annotations", command.myCount),
|
||||
NotificationType.INFORMATION)
|
||||
.notify(project);
|
||||
}
|
||||
}
|
||||
@@ -303,6 +300,11 @@ public class InferNullityAnnotationsAction extends BaseAnalysisAction {
|
||||
};
|
||||
}
|
||||
|
||||
private static NotificationGroup getNotificationGroup() {
|
||||
return NotificationGroupManager.getInstance()
|
||||
.getNotificationGroup("Infer Nullity");
|
||||
}
|
||||
|
||||
protected void restartAnalysis(final @NotNull Project project, final @NotNull AnalysisScope scope) {
|
||||
AppUIExecutor.onUiThread().inSmartMode(project).execute(() -> analyze(project, scope));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user