From 39416deb2398b90118e7400504a6d7ebb5cf187c Mon Sep 17 00:00:00 2001 From: Cheryl King Date: Mon, 5 Jun 2023 16:39:25 -0500 Subject: [PATCH] Check for empty feature --- .../tools/common/plugins/util/ServerFeatureUtil.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/openliberty/tools/common/plugins/util/ServerFeatureUtil.java b/src/main/java/io/openliberty/tools/common/plugins/util/ServerFeatureUtil.java index 0c61c266..478fd5f8 100644 --- a/src/main/java/io/openliberty/tools/common/plugins/util/ServerFeatureUtil.java +++ b/src/main/java/io/openliberty/tools/common/plugins/util/ServerFeatureUtil.java @@ -371,7 +371,12 @@ private Set parseFeatureManagerNode(Element node) { } else { content = content.trim(); } - result.add(content); + // Check for empty feature element, skip it and log warning. + if (content.isEmpty()) { + warn("An empty feature was specified in a server configuration file. Ensure that the features are valid."); + } else { + result.add(content); + } } } }