Commit 4d1d3d65 by huangfusuper

执行机占位异常BUG

parent e43c5f3b
...@@ -50,11 +50,11 @@ public class PlaceholderUtils { ...@@ -50,11 +50,11 @@ public class PlaceholderUtils {
//寻找这个替换符 结束的位置 //寻找这个替换符 结束的位置
int endIndex = sbt.indexOf(PLACEHOLDER_SUFFIX, startIndex + PLACEHOLDER_PREFIX.length()); int endIndex = sbt.indexOf(PLACEHOLDER_SUFFIX, startIndex + PLACEHOLDER_PREFIX.length());
//确定是否存在后缀 //确定是否存在后缀
int nextIndex= 0 ;
if(endIndex != -1){ if(endIndex != -1){
//截取变量值 //截取变量值
String placeholder = sbt.substring(startIndex + PLACEHOLDER_PREFIX.length(), endIndex); String placeholder = sbt.substring(startIndex + PLACEHOLDER_PREFIX.length(), endIndex);
//确定下一次查询的位置 //确定下一次查询的位置
int nextIndex;
//开始从 map中解析 //开始从 map中解析
if(parameter.containsKey(placeholder)){ if(parameter.containsKey(placeholder)){
String placeholderValue = parameter.get(placeholder); String placeholderValue = parameter.get(placeholder);
...@@ -62,8 +62,6 @@ public class PlaceholderUtils { ...@@ -62,8 +62,6 @@ public class PlaceholderUtils {
sbt.replace(startIndex,endIndex+PLACEHOLDER_SUFFIX.length(),placeholderValue); sbt.replace(startIndex,endIndex+PLACEHOLDER_SUFFIX.length(),placeholderValue);
//再次计算替换后的查询开始位置 //再次计算替换后的查询开始位置
nextIndex = startIndex+placeholderValue.length(); nextIndex = startIndex+placeholderValue.length();
}else{
throw new RuntimeException("站位解析异常");
} }
startIndex = sbt.indexOf(PLACEHOLDER_PREFIX,nextIndex); startIndex = sbt.indexOf(PLACEHOLDER_PREFIX,nextIndex);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment