Skip to content

Commit 7663a25

Browse files
authored
Merge pull request #471 from arunvenmany-ibm/variable_allow_empty_fix
allow empty values for variable resolution
2 parents ede9360 + 74cb8e1 commit 7663a25

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/io/openliberty/tools/common/plugins/util/VariableUtility.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public static String resolveVariables(CommonLoggerI log, String nodeValue, Colle
6868
for (String nextVariable : variablesToResolve) {
6969
String value = getPropertyValue(nextVariable, props, defaultProps, libDirPropFiles);
7070

71-
if (value == null || value.isEmpty()) {
71+
if (value == null) {
7272
// Variable could not be resolved. Log message and return null.
7373
log.debug("Variable " + nextVariable + " cannot be resolved.");
7474
return null;
@@ -183,11 +183,11 @@ public static List<Properties> parseVariables(Document doc, boolean defaultValue
183183
String varValue = getValue(attr, "value");
184184
String varDefaultValue = getValue(attr, "defaultValue");
185185

186-
if ((values || both) && (varValue != null && !varValue.isEmpty())) {
186+
if ((values || both) && varValue != null) {
187187
props.setProperty(varName, varValue);
188188
}
189189

190-
if ((defaultValues || both) && (varDefaultValue != null && ! varDefaultValue.isEmpty())) {
190+
if ((defaultValues || both) && varDefaultValue != null) {
191191
defaultProps.setProperty(varName, varDefaultValue);
192192
}
193193
}

0 commit comments

Comments
 (0)