activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [activemq-artemis] branch 2.6.x updated: ARTEMIS-1058 Fixing testsuite
Date Tue, 12 Feb 2019 08:43:56 GMT
This is an automated email from the ASF dual-hosted git repository.

clebertsuconic pushed a commit to branch 2.6.x
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/2.6.x by this push:
     new 3a25748  ARTEMIS-1058 Fixing testsuite
3a25748 is described below

commit 3a25748936d27937000c50c67281cb03d719c2f1
Author: Clebert Suconic <clebertsuconic@apache.org>
AuthorDate: Tue Feb 12 09:42:28 2019 +0100

    ARTEMIS-1058 Fixing testsuite
    
    Possible NPE that will happen on ReplicatedFailoverTest only
    
    (cherry picked from commit b80a78d885e2568af41fc133b0185399385eda0c)
---
 .../activemq/artemis/utils/SpawnedVMSupport.java       | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/SpawnedVMSupport.java
b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/SpawnedVMSupport.java
index 64ead66..38f41e6 100644
--- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/SpawnedVMSupport.java
+++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/SpawnedVMSupport.java
@@ -141,13 +141,19 @@ public class SpawnedVMSupport {
 
       StringBuilder stringBuilder = new StringBuilder();
       boolean empty = true;
-      for (File f : libfolder.listFiles()) {
-         if (f.getName().endsWith(".jar") || f.getName().endsWith(".zip")) {
-            if (!empty) {
-               stringBuilder.append(File.pathSeparator);
+      File[] files = libfolder.listFiles();
+
+      if (files == null) {
+         return getClassPath();
+      } else {
+         for (File f : libfolder.listFiles()) {
+            if (f.getName().endsWith(".jar") || f.getName().endsWith(".zip")) {
+               if (!empty) {
+                  stringBuilder.append(File.pathSeparator);
+               }
+               empty = false;
+               stringBuilder.append(f.toString());
             }
-            empty = false;
-            stringBuilder.append(f.toString());
          }
       }
 


Mime
View raw message