Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

properties 支持list 属性 #285

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,26 @@ public void inject2Store(String fileName, DisconfValue disconfValue) {

Object object = disconfValue.getFileData().get(fileItem);
if (object == null) {
LOGGER.error("cannot find {} to be injected. file content is: {}", fileItem,
disconfValue.getFileData().toString());
continue;
//bug fix by liujing if list map set condition

Map<String,Object> map = disconfValue.getFileData();
int jcount = 0;
for(Map.Entry<String,Object> entry : map.entrySet()){
String key = entry.getKey();
if(key != null && key.startsWith(fileItem)){
if(jcount==0){
object = new ArrayList<String>();
}
((List)object).add(entry.getValue());
jcount++;
}
}

if(object==null){
LOGGER.error("cannot find {} to be injected. file content is: {}", fileItem,
disconfValue.getFileData().toString());
continue;
}
}

// 根据类型设置值
Expand Down