Merge pull request #583 from shaiktaj/patch-1

Updated ThreadSafeLazyLoadedivoryTower
This commit is contained in:
Ilkka Seppälä 2017-08-12 16:58:01 +03:00 committed by GitHub
commit 600553ec0f

View File

@ -33,7 +33,12 @@ public final class ThreadSafeLazyLoadedIvoryTower {
private static ThreadSafeLazyLoadedIvoryTower instance;
private ThreadSafeLazyLoadedIvoryTower() {}
private ThreadSafeLazyLoadedIvoryTower() {
// to prevent instantiating by Reflection call
if (instance != null) {
throw new IllegalStateException("Already initialized.");
}
}
/**
* The instance gets created only when it is called for first time. Lazy-loading