Reverting initialization on demand holder idiom.

This commit is contained in:
leogtzr 2017-01-22 11:06:57 -07:00
parent e26215578c
commit c6d0d28557

View File

@ -32,12 +32,10 @@ public final class IvoryTower {
*/ */
private IvoryTower() {} private IvoryTower() {}
private static class IvoryTowerHolder {
/** /**
* Static to class instance of the class. * Static to class instance of the class.
*/ */
private static final IvoryTower INSTANCE = new IvoryTower(); private static final IvoryTower INSTANCE = new IvoryTower();
}
/** /**
* To be called by user to obtain instance of the class. * To be called by user to obtain instance of the class.
@ -45,6 +43,6 @@ public final class IvoryTower {
* @return instance of the singleton. * @return instance of the singleton.
*/ */
public static IvoryTower getInstance() { public static IvoryTower getInstance() {
return IvoryTowerHolder.INSTANCE; return INSTANCE;
} }
} }