[jbosscache-commits] JBoss Cache SVN: r7549 - experimental/jsr166/src/jsr166y.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Tue Jan 20 14:56:06 EST 2009


Author: jason.greene at jboss.com
Date: 2009-01-20 14:56:06 -0500 (Tue, 20 Jan 2009)
New Revision: 7549

Modified:
   experimental/jsr166/src/jsr166y/ConcurrentReferenceHashMap.java
   experimental/jsr166/src/jsr166y/ConcurrentReferenceHashMapGCTestCase.java
Log:
Add a couple constructors

Modified: experimental/jsr166/src/jsr166y/ConcurrentReferenceHashMap.java
===================================================================
--- experimental/jsr166/src/jsr166y/ConcurrentReferenceHashMap.java	2009-01-20 19:38:05 UTC (rev 7548)
+++ experimental/jsr166/src/jsr166y/ConcurrentReferenceHashMap.java	2009-01-20 19:56:06 UTC (rev 7549)
@@ -955,6 +955,35 @@
     }
 
     /**
+     * Creates a new, empty reference map with the specified key
+     * and value reference types.
+     *
+     * @param keyType the reference type to use for keys
+     * @param valueType the reference type to use for values
+     * @throws IllegalArgumentException if the initial capacity of
+     * elements is negative.
+     */
+    public ConcurrentReferenceHashMap(ReferenceType keyType, ReferenceType valueType) {
+        this(DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR, DEFAULT_CONCURRENCY_LEVEL,
+                keyType, valueType, null);
+    }
+
+    /**
+     * Creates a new, empty reference map with the specified reference types
+     * and behavioral options.
+     *
+     * @param keyType the reference type to use for keys
+     * @param valueType the reference type to use for values
+     * @throws IllegalArgumentException if the initial capacity of
+     * elements is negative.
+     */
+    public ConcurrentReferenceHashMap(ReferenceType keyType, ReferenceType valueType, EnumSet<Option> options) {
+        this(DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR, DEFAULT_CONCURRENCY_LEVEL,
+                keyType, valueType, options);
+    }
+
+
+    /**
      * Creates a new, empty map with the specified initial capacity,
      * and with default reference types (weak keys, strong values),
      * load factor (0.75) and concurrencyLevel (16).

Modified: experimental/jsr166/src/jsr166y/ConcurrentReferenceHashMapGCTestCase.java
===================================================================
--- experimental/jsr166/src/jsr166y/ConcurrentReferenceHashMapGCTestCase.java	2009-01-20 19:38:05 UTC (rev 7548)
+++ experimental/jsr166/src/jsr166y/ConcurrentReferenceHashMapGCTestCase.java	2009-01-20 19:56:06 UTC (rev 7549)
@@ -36,7 +36,7 @@
 
     private void values(boolean soft) throws Exception {
         ConcurrentReferenceHashMap<String, Integer> map =
-            new ConcurrentReferenceHashMap<String, Integer>(16,
+            new ConcurrentReferenceHashMap<String, Integer>(
                     ReferenceType.STRONG,
                     soft ? ReferenceType.SOFT : ReferenceType.WEAK);
 




More information about the jbosscache-commits mailing list