From commits-return-55090-apmail-activemq-commits-archive=activemq.apache.org@activemq.apache.org Tue Feb 12 08:43:10 2019 Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8CA8A18835 for ; Tue, 12 Feb 2019 08:43:10 +0000 (UTC) Received: (qmail 2711 invoked by uid 500); 12 Feb 2019 08:43:10 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 2673 invoked by uid 500); 12 Feb 2019 08:43:10 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 2663 invoked by uid 99); 12 Feb 2019 08:43:10 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Feb 2019 08:43:10 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id BB9DD82998; Tue, 12 Feb 2019 08:43:09 +0000 (UTC) Date: Tue, 12 Feb 2019 08:43:09 +0000 To: "commits@activemq.apache.org" Subject: [activemq-artemis] branch master updated: ARTEMIS-1058 Fixing testsuite MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <154996098952.12462.8266456535802086896@gitbox.apache.org> From: clebertsuconic@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: activemq-artemis X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 8edca409f6d0e3fa1a509b4d376a11022e8712ff X-Git-Newrev: b80a78d885e2568af41fc133b0185399385eda0c X-Git-Rev: b80a78d885e2568af41fc133b0185399385eda0c X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. clebertsuconic pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git The following commit(s) were added to refs/heads/master by this push: new b80a78d ARTEMIS-1058 Fixing testsuite b80a78d is described below commit b80a78d885e2568af41fc133b0185399385eda0c Author: Clebert Suconic AuthorDate: Tue Feb 12 09:42:28 2019 +0100 ARTEMIS-1058 Fixing testsuite Possible NPE that will happen on ReplicatedFailoverTest only --- .../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 6f47c82..82724c1 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()); } }