[jboss-cvs] Repository SVN: r2138 - in oswego-concurrent/1.3.4-jboss: src and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Dec 12 13:51:21 EST 2007
Author: jhowell at redhat.com
Date: 2007-12-12 13:51:21 -0500 (Wed, 12 Dec 2007)
New Revision: 2138
Modified:
oswego-concurrent/1.3.4-jboss/lib/concurrent-src.zip
oswego-concurrent/1.3.4-jboss/lib/concurrent.jar
oswego-concurrent/1.3.4-jboss/src/ConcurrentHashMap.patch
Log:
[JBAS-5072] The previous fix 4698, fixed the problem by using iteration instead of values(), but it also allowed nulls to be put into the array, which throws a null pointer exception. I would have used the same defect number, but I missed the window for the versions that 4698 fixed, so I opened a new defect.
Modified: oswego-concurrent/1.3.4-jboss/lib/concurrent-src.zip
===================================================================
(Binary files differ)
Modified: oswego-concurrent/1.3.4-jboss/lib/concurrent.jar
===================================================================
(Binary files differ)
Modified: oswego-concurrent/1.3.4-jboss/src/ConcurrentHashMap.patch
===================================================================
--- oswego-concurrent/1.3.4-jboss/src/ConcurrentHashMap.patch 2007-12-12 18:25:10 UTC (rev 2137)
+++ oswego-concurrent/1.3.4-jboss/src/ConcurrentHashMap.patch 2007-12-12 18:51:21 UTC (rev 2138)
@@ -1,8 +1,8 @@
---- src/EDU/oswego/cs/dl/util/concurrent/ConcurrentHashMap.java 2007-09-11 14:32:37.000000000 +0200
-+++ /home/ejort/temp/ConcurrentHashMap.java 2005-07-15 20:47:11.000000000 +0200
-@@ -19,20 +19,22 @@
- Date Who What
- 26nov2000 dl Created, based on ConcurrentReaderHashMap
+Index: /root/jboss/4.0.5GA/oswegolocalrepos/src/EDU/oswego/cs/dl/util/concurrent/ConcurrentHashMap.java
+===================================================================
+--- /root/jboss/4.0.5GA/oswegolocalrepos/src/EDU/oswego/cs/dl/util/concurrent/ConcurrentHashMap.java (revision 4)
++++ /root/jboss/4.0.5GA/oswegolocalrepos/src/EDU/oswego/cs/dl/util/concurrent/ConcurrentHashMap.java (working copy)
+@@ -21,6 +21,7 @@
12jan2001 dl public release
17nov2001 dl Minor tunings
24oct2003 dl Segment implements Serializable
@@ -10,10 +10,7 @@
*/
package EDU.oswego.cs.dl.util.concurrent;
-
- import java.util.Map;
- import java.util.AbstractMap;
- import java.util.AbstractSet;
+@@ -31,6 +32,7 @@
import java.util.AbstractCollection;
import java.util.Collection;
import java.util.Set;
@@ -21,74 +18,102 @@
import java.util.Iterator;
import java.util.Enumeration;
import java.util.NoSuchElementException;
-
- import java.io.Serializable;
-@@ -877,10 +879,22 @@
- return ConcurrentHashMap.this.remove(o) != null;
- }
+@@ -879,6 +881,32 @@
public void clear() {
ConcurrentHashMap.this.clear();
}
+ public Object[] toArray() {
+ Collection c = new ArrayList();
++ Object o=null;
+ for (Iterator i = iterator(); i.hasNext(); )
-+ c.add(i.next());
++ {
++ o = i.next();
++ if(o!=null)
++ {
++ c.add(o);
++ }
++ }
+ return c.toArray();
+ }
+ public Object[] toArray(Object[] a) {
+ Collection c = new ArrayList();
++ Object o=null;
+ for (Iterator i = iterator(); i.hasNext(); )
-+ c.add(i.next());
++ {
++ o = i.next();
++ if(o!=null)
++ {
++ c.add(o);
++ }
++ }
+ return c.toArray(a);
+ }
}
/**
- * Returns a collection view of the values contained in this map. The
- * collection is backed by the map, so changes to the map are reflected in
-@@ -909,10 +923,22 @@
- return ConcurrentHashMap.this.containsValue(o);
- }
+@@ -911,6 +939,32 @@
public void clear() {
ConcurrentHashMap.this.clear();
}
+ public Object[] toArray() {
+ Collection c = new ArrayList();
++ Object o=null;
+ for (Iterator i = iterator(); i.hasNext(); )
-+ c.add(i.next());
++ {
++ o = i.next();
++ if(o!=null)
++ {
++ c.add(o);
++ }
++ }
+ return c.toArray();
+ }
+ public Object[] toArray(Object[] a) {
+ Collection c = new ArrayList();
++ Object o=null;
+ for (Iterator i = iterator(); i.hasNext(); )
-+ c.add(i.next());
++ {
++ o = i.next();
++ if(o!=null)
++ {
++ c.add(o);
++ }
++ }
+ return c.toArray(a);
+ }
}
/**
- * Returns a collection view of the mappings contained in this map. Each
- * element in the returned collection is a <tt>Map.Entry</tt>. The
-@@ -952,10 +978,22 @@
- return ConcurrentHashMap.this.size();
- }
+@@ -954,6 +1008,32 @@
public void clear() {
ConcurrentHashMap.this.clear();
}
+ public Object[] toArray() {
+ Collection c = new ArrayList();
++ Object o=null;
+ for (Iterator i = iterator(); i.hasNext(); )
-+ c.add(i.next());
++ {
++ o = i.next();
++ if(o!=null)
++ {
++ c.add(o);
++ }
++ }
+ return c.toArray();
+ }
+ public Object[] toArray(Object[] a) {
+ Collection c = new ArrayList();
++ Object o=null;
+ for (Iterator i = iterator(); i.hasNext(); )
-+ c.add(i.next());
++ {
++ o = i.next();
++ if(o!=null)
++ {
++ c.add(o);
++ }
++ }
+ return c.toArray(a);
+ }
}
/**
- * Returns an enumeration of the keys in this table.
- *
More information about the jboss-cvs-commits
mailing list