[jboss-cvs] JBossAS SVN: r76000 - branches/JBPAPP_4_2_0_GA_CP/messaging/src/main/org/jboss/mq/pm.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Jul 18 10:38:14 EDT 2008


Author: jhowell at redhat.com
Date: 2008-07-18 10:38:14 -0400 (Fri, 18 Jul 2008)
New Revision: 76000

Modified:
   branches/JBPAPP_4_2_0_GA_CP/messaging/src/main/org/jboss/mq/pm/TxManager.java
Log:
[JBPAPP-596] Fix Race condition using the toArray(Object[]), where nulls end up in the returned array

Modified: branches/JBPAPP_4_2_0_GA_CP/messaging/src/main/org/jboss/mq/pm/TxManager.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/messaging/src/main/org/jboss/mq/pm/TxManager.java	2008-07-18 12:48:41 UTC (rev 75999)
+++ branches/JBPAPP_4_2_0_GA_CP/messaging/src/main/org/jboss/mq/pm/TxManager.java	2008-07-18 14:38:14 UTC (rev 76000)
@@ -314,7 +314,9 @@
    public Xid[] recover(ConnectionToken dc, int flags) throws Exception
    {
       Set preparedXids = prepared.keySet();
-      Xid[] xids = (Xid[]) preparedXids.toArray(new Xid[preparedXids.size()]);
+      //This seems rather strange, but we fixed the toArray that takes a new collection(toArray(Object[]), but not the toArray method itself(toArray()),
+      //so instead of respinning the oswego jar again, we do toArray(new Xid[0]), which will fix problem JBPAPP-596
+      Xid[] xids = (Xid[]) preparedXids.toArray(new Xid[0]);
       return xids;
    }
    




More information about the jboss-cvs-commits mailing list