修复参数替换数组的Bug

This commit is contained in:
seagull 2019-02-15 15:56:24 +08:00
parent aa5f85bc99
commit c8593ad1a8
1 changed files with 31 additions and 20 deletions

View File

@ -216,27 +216,38 @@ public class ChangString {
}
//如果是list就提取出来
if(entry.getValue() instanceof List){
@SuppressWarnings("rawtypes")
List list = (List)entry.getValue();
for (int i = 0; i < list.size(); i++) {
//如何还有循环提取
try{
list.set(i, parseJsonString(list.get(i).toString(),key,value,keyindex));
entry.setValue(list);
}catch(JSONException jsone){
if(key.equals(entry.getKey())){
if(keyindex==COUNTER){
luckyclient.publicclass.LogUtil.APP.info("对象原始List值"+entry.getValue()+"");
JSONArray jsonarr = JSONArray.parseArray(value);
entry.setValue(jsonarr);
luckyclient.publicclass.LogUtil.APP.info("对象替换后List值"+entry.getValue()+"");
BCHANG=true;
}
COUNTER++;
if(key.equals(entry.getKey())){
if(keyindex==COUNTER){
luckyclient.publicclass.LogUtil.APP.info("对象原始String值"+entry.getValue()+"");
JSONArray jsonarr = JSONArray.parseArray(value);
entry.setValue(jsonarr);
luckyclient.publicclass.LogUtil.APP.info("对象替换后String值"+entry.getValue()+"");
BCHANG=true;
}
COUNTER++;
}else{
@SuppressWarnings("rawtypes")
List list = (List)entry.getValue();
for (int i = 0; i < list.size(); i++) {
//如何还有循环提取
try{
list.set(i, parseJsonString(list.get(i).toString(),key,value,keyindex));
entry.setValue(list);
}catch(JSONException jsone){
if(key.equals(entry.getKey())){
if(keyindex==COUNTER){
luckyclient.publicclass.LogUtil.APP.info("对象原始List值"+entry.getValue()+"");
JSONArray jsonarr = JSONArray.parseArray(value);
entry.setValue(jsonarr);
luckyclient.publicclass.LogUtil.APP.info("对象替换后List值"+entry.getValue()+"");
BCHANG=true;
}
COUNTER++;
}
break;
}
break;
}
}
}
}
}
//如果是String就获取它的值
if(entry.getValue() instanceof String){