Skip to content

Commit af93754

Browse files
committed
fixed empty config
1 parent 9f2fc74 commit af93754

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

instance/spring/src/main/java/com/alibaba/otter/canal/instance/spring/support/PropertyPlaceholderConfigurer.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import java.util.List;
55
import java.util.Properties;
66

7+
import org.apache.commons.lang.StringUtils;
78
import org.springframework.beans.factory.InitializingBean;
89
import org.springframework.context.ResourceLoaderAware;
910
import org.springframework.core.io.Resource;
@@ -126,20 +127,20 @@ protected String resolvePlaceholder(String placeholder, Properties props, int sy
126127
}
127128

128129
// 以threadlocal的为准覆盖file properties
129-
if (propVal == null) {
130+
if (StringUtils.isBlank(propVal)) {
130131
Properties localProperties = propertiesLocal.get();
131132
propVal = resolvePlaceholder(dp.placeholder, localProperties);
132133
}
133134

134-
if (propVal == null) {
135+
if (StringUtils.isBlank(propVal)) {
135136
propVal = resolvePlaceholder(dp.placeholder, props);
136137
}
137138

138-
if (propVal == null && systemPropertiesMode == SYSTEM_PROPERTIES_MODE_FALLBACK) {
139+
if (StringUtils.isBlank(propVal) && systemPropertiesMode == SYSTEM_PROPERTIES_MODE_FALLBACK) {
139140
propVal = resolveSystemProperty(dp.placeholder);
140141
}
141142

142-
if (propVal == null) {
143+
if (StringUtils.isBlank(propVal)) {
143144
propVal = dp.defaultValue;
144145
}
145146

0 commit comments

Comments
 (0)