Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions api/src/main/java/javax/config/ConfigProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@
* @author <a href="mailto:[email protected]">Viktor Klang</a>
*/
public final class ConfigProvider {
private static final ConfigProviderResolver INSTANCE = ConfigProviderResolver.instance();

private static class LazyHolder {
private static final ConfigProviderResolver INSTANCE = ConfigProviderResolver.instance();
}

private ConfigProvider() {
}
Expand All @@ -86,7 +89,7 @@ private ConfigProvider() {
* @return the config object for the thread context classloader
*/
public static Config getConfig() {
return INSTANCE.getConfig();
return LazyHolder.INSTANCE.getConfig();
}

/**
Expand All @@ -100,6 +103,6 @@ public static Config getConfig() {
* @return the config for the specified classloader
*/
public static Config getConfig(ClassLoader classloader) {
return INSTANCE.getConfig(classloader);
return LazyHolder.INSTANCE.getConfig(classloader);
}
}