Reverting initialization on demand holder idiom.
This commit is contained in:
parent
e26215578c
commit
c6d0d28557
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user