You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by pj...@apache.org on 2002/08/10 02:49:45 UTC
cvs commit: jakarta-commons/collections/src/java/org/apache/commons/collections FastArrayList.java FastHashMap.java FastTreeMap.java
pjack 2002/08/09 17:49:45
Modified: collections/src/java/org/apache/commons/collections
FastArrayList.java FastHashMap.java
FastTreeMap.java
Log:
Added documentation that clearly indicates that these classes will not
work reliably on some architectures.
PR:9206
Revision Changes Path
1.6 +16 -4 jakarta-commons/collections/src/java/org/apache/commons/collections/FastArrayList.java
Index: FastArrayList.java
===================================================================
RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/FastArrayList.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- FastArrayList.java 12 Jun 2002 03:59:15 -0000 1.5
+++ FastArrayList.java 10 Aug 2002 00:49:45 -0000 1.6
@@ -93,6 +93,18 @@
* <code>java.util.ArrayList</code> directly (with no synchronization), for
* maximum performance.</p>
*
+ * <P><strong>NOTE</strong>: <I>This class is not cross-platform.
+ * Using it may cause unexpected failures on some architectures.</I>
+ * It suffers from the same problems as the double-checked locking idiom.
+ * In particular, the instruction that clones the internal collection and the
+ * instruction that sets the internal reference to the clone can be executed
+ * or perceived out-of-order. This means that any read operation might fail
+ * unexpectedly, as it may be reading the state of the internal collection
+ * before the internal collection is fully formed.
+ * For more information on the double-checked locking idiom, see the
+ * <A Href="http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html">
+ * Double-Checked Locking Idiom Is Broken Declartion</A>.</P>
+ *
* @since 1.0
* @author Craig R. McClanahan
* @version $Revision$ $Date$
1.7 +16 -4 jakarta-commons/collections/src/java/org/apache/commons/collections/FastHashMap.java
Index: FastHashMap.java
===================================================================
RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/FastHashMap.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- FastHashMap.java 12 Jun 2002 03:59:15 -0000 1.6
+++ FastHashMap.java 10 Aug 2002 00:49:45 -0000 1.7
@@ -94,6 +94,18 @@
* <code>java.util.HashMap</code> directly (with no synchronization), for
* maximum performance.</p>
*
+ * <P><strong>NOTE</strong>: <I>This class is not cross-platform.
+ * Using it may cause unexpected failures on some architectures.</I>
+ * It suffers from the same problems as the double-checked locking idiom.
+ * In particular, the instruction that clones the internal collection and the
+ * instruction that sets the internal reference to the clone can be executed
+ * or perceived out-of-order. This means that any read operation might fail
+ * unexpectedly, as it may be reading the state of the internal collection
+ * before the internal collection is fully formed.
+ * For more information on the double-checked locking idiom, see the
+ * <A Href="http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html">
+ * Double-Checked Locking Idiom Is Broken Declartion</A>.</P>
+ *
* @since 1.0
* @author Craig R. McClanahan
* @version $Revision$ $Date$
1.7 +16 -4 jakarta-commons/collections/src/java/org/apache/commons/collections/FastTreeMap.java
Index: FastTreeMap.java
===================================================================
RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/FastTreeMap.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- FastTreeMap.java 12 Jun 2002 03:59:15 -0000 1.6
+++ FastTreeMap.java 10 Aug 2002 00:49:45 -0000 1.7
@@ -96,6 +96,18 @@
* <code>java.util.TreeMap</code> directly (with no synchronization), for
* maximum performance.</p>
*
+ * <P><strong>NOTE</strong>: <I>This class is not cross-platform.
+ * Using it may cause unexpected failures on some architectures.</I>
+ * It suffers from the same problems as the double-checked locking idiom.
+ * In particular, the instruction that clones the internal collection and the
+ * instruction that sets the internal reference to the clone can be executed
+ * or perceived out-of-order. This means that any read operation might fail
+ * unexpectedly, as it may be reading the state of the internal collection
+ * before the internal collection is fully formed.
+ * For more information on the double-checked locking idiom, see the
+ * <A Href="http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html">
+ * Double-Checked Locking Idiom Is Broken Declartion</A>.</P>
+ *
* @since 1.0
* @author Craig R. McClanahan
* @version $Revision$ $Date$
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>