mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 03:21:12 +07:00
show warning when registry value requested before Registry is initialized
GitOrigin-RevId: c162d876ff9967bb6772ed2ebd16f87b1027a9e1
This commit is contained in:
committed by
intellij-monorepo-bot
parent
4591f890b2
commit
12924fa8e7
@@ -31,6 +31,7 @@ public final class Registry {
|
||||
private final THashMap<String, RegistryKeyDescriptor> myContributedKeys = new THashMap<>();
|
||||
|
||||
private static final Registry ourInstance = new Registry();
|
||||
private volatile boolean myLoaded = false;
|
||||
|
||||
@NotNull
|
||||
public static RegistryValue get(@NotNull String key) {
|
||||
@@ -151,6 +152,11 @@ public final class Registry {
|
||||
}
|
||||
}
|
||||
}
|
||||
myLoaded = true;
|
||||
}
|
||||
|
||||
public boolean isLoaded() {
|
||||
return myLoaded;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -170,6 +170,11 @@ public class RegistryValue {
|
||||
if (systemProperty != null) {
|
||||
return systemProperty;
|
||||
}
|
||||
|
||||
if (!myRegistry.isLoaded()) {
|
||||
LOG.warn("The registry key '" + key + "' accessed, but not loaded yet");
|
||||
}
|
||||
|
||||
final String bundleValue = Registry.getInstance().getBundleValue(key, mustExistInBundle);
|
||||
if (bundleValue != null) {
|
||||
return bundleValue;
|
||||
|
||||
Reference in New Issue
Block a user