Reformat rest of the design patterns - Issue

This commit is contained in:
Ankur Kaushal
2015-11-01 21:29:13 -05:00
parent 449340bd2b
commit 306b1f3d31
337 changed files with 6744 additions and 6851 deletions
double-checked-locking/src
main
java
com
iluwatar
test
java
com
iluwatar
doublechecked
double-dispatch/src
event-aggregator/src
execute-around/src
main
test
java
com
iluwatar
execute
facade/src
factory-method/src
fluentinterface/src/main/java/com/iluwatar/fluentinterface/app
flux/src
flyweight/src
half-sync-half-async/src
main
java
test
java
com
iluwatar
halfsynchalfasync
intercepting-filter/src
interpreter/src
iterator/src
layers/src
lazy-loading/src
mediator/src
memento/src
main
java
test
java
com
iluwatar
message-channel/src
main
java
com
iluwatar
message
channel
test
java
com
iluwatar
message
model-view-controller/src
main
test
java
com
iluwatar
model
view
controller
model-view-presenter/src
monostate/src
main
test
java
com
iluwatar
monostate
multiton/src
main
java
test
java
com
iluwatar
multiton
naked-objects
dom
src
fixture
integtests
webapp
src
main
java
domainapp
null-object/src
main
test
java
com
iluwatar
nullobject
object-pool/src
main
test
java
com
iluwatar
object
poison-pill/src
private-class-data/src
main
test
java
com
iluwatar
privateclassdata
property/src
main
test
java
com
iluwatar
property
prototype/src
proxy/src
main
test
java
com
iluwatar
reactor/src
main
test
java
com
iluwatar
reactor
repository/src
main
test
java
com
iluwatar
repository
resource-acquisition-is-initialization/src
main
java
com
iluwatar
resource
test
java
com
iluwatar
resource
acquisition
is
initialization
servant/src
main
test
java
com
iluwatar
service-layer/src
service-locator/src
singleton/src
specification/src
state/src
step-builder/src
main
test
java
com
iluwatar
stepbuilder
strategy/src
template-method/src
main
test
java
com
iluwatar
templatemethod
thread-pool/src
main
test
java
com
iluwatar
threadpool
tolerant-reader/src
main
test
java
com
iluwatar
tolerantreader
visitor/src

@ -2,23 +2,22 @@ package com.iluwatar.lazy.loading;
/**
*
* Same as HolderNaive but with added synchronization.
* This implementation is thread safe, but each {@link #getHeavy()}
* call costs additional synchronization overhead.
* Same as HolderNaive but with added synchronization. This implementation is thread safe, but each
* {@link #getHeavy()} call costs additional synchronization overhead.
*
*/
public class HolderThreadSafe {
private Heavy heavy;
public HolderThreadSafe() {
System.out.println("HolderThreadSafe created");
}
public synchronized Heavy getHeavy() {
if (heavy == null) {
heavy = new Heavy();
}
return heavy;
}
private Heavy heavy;
public HolderThreadSafe() {
System.out.println("HolderThreadSafe created");
}
public synchronized Heavy getHeavy() {
if (heavy == null) {
heavy = new Heavy();
}
return heavy;
}
}