[ui] Make DeferredSelection singleton non-lazy

#IDEA-335018

GitOrigin-RevId: 0599dc9cede32ae822361f64a348a593427c8a31
This commit is contained in:
Bart van Helvert
2023-10-27 14:03:24 +02:00
committed by intellij-monorepo-bot
parent 1fd5a408bb
commit d4b27bcc4e

View File

@@ -368,7 +368,7 @@ public class EditorTextField extends NonOpaquePanel implements EditorTextCompone
void execute(@NotNull Editor editor);
final class All implements DeferredSelection {
private static @Nullable All instance;
private static final @NotNull All INSTANCE = new DeferredSelection.All();
private All() {
}
@@ -379,15 +379,12 @@ public class EditorTextField extends NonOpaquePanel implements EditorTextCompone
}
public static @NotNull All getInstance() {
if (instance == null) {
instance = new DeferredSelection.All();
}
return instance;
return INSTANCE;
}
}
final class None implements DeferredSelection {
private static @Nullable None instance;
private static final @NotNull None INSTANCE = new DeferredSelection.None();
private None() {
}
@@ -398,10 +395,7 @@ public class EditorTextField extends NonOpaquePanel implements EditorTextCompone
}
public static @NotNull None getInstance() {
if (instance == null) {
instance = new DeferredSelection.None();
}
return instance;
return INSTANCE;
}
}