8000 add some references to class comments · mavencode01/java-design-patterns@c06c057 · GitHub
[go: up one dir, main page]

Skip to content

Commit c06c057

Browse files
committed
add some references to class comments
1 parent dbc1ca7 commit c06c057

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

singleton/src/main/java/com/iluwatar/InitializingOnDemandHolderIdiom.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
import java.io.Serializable;
44

55
/**
6+
* The Initialize-on-demand-holder idiom is a secure way of
7+
* creating lazy initialize singleton Object in Java.
8+
* refer to "The CERT Oracle Secure Coding Standard for Java"
9+
* By Dhruv Mohindra, Robert C. Seacord p.378
10+
*
11+
* Singleton objects usually are heavy to create and sometimes need to serialize them.
12+
* This class also shows how to preserve singleton in Serialized version of singleton.
613
*
714
* @author mortezaadi@gmail.com
815
*

singleton/src/main/java/com/iluwatar/ThreadSafeDoubleCheckLocking.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package com.iluwatar;
22

33
/**
4+
* Double check locking
5+
*
6+
* http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html
7+
*
48
* Broken under Java 1.4.
59
* @author mortezaadi@gmail.com
610
*

0 commit comments

Comments
 (0)
0