Skip to content

Commit

Permalink
Merge pull request #583 from shaiktaj/patch-1
Browse files Browse the repository at this point in the history
Updated ThreadSafeLazyLoadedivoryTower
  • Loading branch information
iluwatar committed Aug 12, 2017
2 parents 54d8ec9 + 24f2588 commit 600553e
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 600553e

Please sign in to comment.