[hornetq-commits] JBoss hornetq SVN: r11591 - trunk/hornetq-core/src/test/java/org/hornetq/tests/util.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Oct 25 08:32:42 EDT 2011


Author: borges
Date: 2011-10-25 08:32:41 -0400 (Tue, 25 Oct 2011)
New Revision: 11591

Modified:
   trunk/hornetq-core/src/test/java/org/hornetq/tests/util/UnitTestCase.java
Log:
Fix NPE affecting Hudson tests.

Modified: trunk/hornetq-core/src/test/java/org/hornetq/tests/util/UnitTestCase.java
===================================================================
--- trunk/hornetq-core/src/test/java/org/hornetq/tests/util/UnitTestCase.java	2011-10-25 12:32:28 UTC (rev 11590)
+++ trunk/hornetq-core/src/test/java/org/hornetq/tests/util/UnitTestCase.java	2011-10-25 12:32:41 UTC (rev 11591)
@@ -924,14 +924,24 @@
    {
       List<ClientSessionFactoryImpl.CloseRunnable> closeRunnables = new ArrayList<ClientSessionFactoryImpl.CloseRunnable>(ClientSessionFactoryImpl.CLOSE_RUNNABLES);
       ArrayList<Exception> exceptions = new ArrayList<Exception>();
-      if(!closeRunnables.isEmpty())
+      try
       {
+         if (!closeRunnables.isEmpty())
+         {
          for (ClientSessionFactoryImpl.CloseRunnable closeRunnable : closeRunnables)
          {
-            exceptions.add(closeRunnable.stop().e);
+               if (closeRunnable != null)
+               {
+                  exceptions.add(closeRunnable.stop().e);
+               }
+            }
          }
       }
-      cleanupPools();
+      finally
+      {
+         cleanupPools();
+      }
+
       //clean up pools before failing
       if(!exceptions.isEmpty())
       {



More information about the hornetq-commits mailing list