Skip to content

Commit

Permalink
修复 配置项value $符号异常 #293 (#317)
Browse files Browse the repository at this point in the history
Co-authored-by: huijun.xu <[email protected]>
Co-authored-by: 胡俊 <[email protected]>
  • Loading branch information
3 people authored May 9, 2024
1 parent fcf0084 commit b209b29
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.util.List;
import java.util.Map;

import org.apache.commons.lang3.StringUtils;
import com.alibaba.nacos.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -181,7 +182,7 @@ public void onApplicationEvent(NacosConfigReceivedEvent event) {
}

private Object resolveNotifyValue(String nacosValueExpr, String key, String newValue) {
String spelExpr = nacosValueExpr.replaceAll("\\$\\{" + key + PLACEHOLDER_SUFFIX, newValue);
String spelExpr = StringUtils.replace(nacosValueExpr, PLACEHOLDER_PREFIX + key + PLACEHOLDER_SUFFIX, newValue);
return resolveStringValue(spelExpr);
}

Expand Down

0 comments on commit b209b29

Please sign in to comment.