|
30 | 30 | * classloader instance and provides global access to it.</p>
|
31 | 31 | *
|
32 | 32 | * <p>One of the risks of this pattern is that bugs resulting from setting a singleton up in a
|
33 |
| - * distributed environment can be tricky to debug, since it will work fine if you debug with a |
| 33 | + * distributed environment can be tricky to debug since it will work fine if you debug with a |
34 | 34 | * single classloader. Additionally, these problems can crop up a while after the implementation of
|
35 |
| - * a singleton, since they may start out synchronous and only become async with time, so it may |
36 |
| - * not be clear why you are seeing certain changes in behaviour.</p> |
| 35 | + * a singleton, since they may start synchronous and only become async with time, so it may |
| 36 | + * not be clear why you are seeing certain changes in behavior.</p> |
37 | 37 | *
|
38 | 38 | * <p>There are many ways to implement the Singleton. The first one is the eagerly initialized
|
39 | 39 | * instance in {@link IvoryTower}. Eager initialization implies that the implementation is thread
|
40 |
| - * safe. If you can afford giving up control of the instantiation moment, then this implementation |
| 40 | + * safe. If you can afford to give up control of the instantiation moment, then this implementation |
41 | 41 | * will suit you fine.</p>
|
42 | 42 | *
|
43 |
| - * <p>The other option to implement eagerly initialized Singleton is enum based Singleton. The |
44 |
| - * example is found in {@link EnumIvoryTower}. At first glance the code looks short and simple. |
| 43 | + * <p>The other option to implement eagerly initialized Singleton is enum-based Singleton. The |
| 44 | + * example is found in {@link EnumIvoryTower}. At first glance, the code looks short and simple. |
45 | 45 | * However, you should be aware of the downsides including committing to implementation strategy,
|
46 |
| - * extending the enum class, serializability and restrictions to coding. These are extensively |
| 46 | + * extending the enum class, serializability, and restrictions to coding. These are extensively |
47 | 47 | * discussed in Stack Overflow: http://programmers.stackexchange.com/questions/179386/what-are-the-downsides-of-implementing
|
48 | 48 | * -a-singleton-with-javas-enum</p>
|
49 | 49 | *
|
|
56 | 56 | * ThreadSafeLazyLoadedIvoryTower} since it doesn't synchronize the whole access method but only the
|
57 | 57 | * method internals on specific conditions.</p>
|
58 | 58 | *
|
59 |
| - * <p>Yet another way to implement thread safe lazily initialized Singleton can be found in |
| 59 | + * <p>Yet another way to implement thread-safe lazily initialized Singleton can be found in |
60 | 60 | * {@link InitializingOnDemandHolderIdiom}. However, this implementation requires at least Java 8
|
61 | 61 | * API level to work.</p>
|
62 | 62 | */
|
|
0 commit comments