Environment

This commit is contained in:
redkale
2024-01-30 21:10:13 +08:00
parent c83aa7e8a8
commit 54d629155b

View File

@@ -91,13 +91,15 @@ public class Environment implements java.io.Serializable {
String subVal = properties.getProperty(key); String subVal = properties.getProperty(key);
if (subVal != null) { if (subVal != null) {
String newVal = getPropertyValue(subVal, envs); String newVal = getPropertyValue(subVal, envs);
return getPropertyValue(val.substring(0, startIndex) + newVal + val.substring(endIndex + 1)); newVal = val.substring(0, startIndex) + newVal + val.substring(endIndex + 1);
return endIndex == chars.length - 1 ? newVal : getPropertyValue(newVal);
} else { } else {
for (Properties prop : envs) { for (Properties prop : envs) {
subVal = prop.getProperty(key); subVal = prop.getProperty(key);
if (subVal != null) { if (subVal != null) {
String newVal = getPropertyValue(subVal, envs); String newVal = getPropertyValue(subVal, envs);
return getPropertyValue(val.substring(0, startIndex) + newVal + val.substring(endIndex + 1)); newVal = val.substring(0, startIndex) + newVal + val.substring(endIndex + 1);
return endIndex == chars.length - 1 ? newVal : getPropertyValue(newVal);
} }
} }
if (pos3 > 0) { if (pos3 > 0) {