mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-03 11:12:23 +00:00
Reverting initialization on demand holder idiom.
This commit is contained in:
1 parent
e26215578c
commit
c6d0d28557
1 file changed
+3
-5
@@ -32,12 +32,10 @@ public final class IvoryTower {
|
||||
*/
|
||||
private IvoryTower() {}
|
||||
|
||||
private static class IvoryTowerHolder {
|
||||
/**
|
||||
/**
|
||||
* 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.
|
||||
@@ -45,6 +43,6 @@ public final class IvoryTower {
|
||||
* @return instance of the singleton.
|
||||
*/
|
||||
public static IvoryTower getInstance() {
|
||||
return IvoryTowerHolder.INSTANCE;
|
||||
return INSTANCE;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user