在idea中能运行成功,但是beanshell脚本报错
import org.apache.commons.codec.digest.DigestUtils;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
Map<String, String> map = new HashMap<>();
map.put("loginAccount", "admin");
map.put("password", "123");
String []keys = map.keySet().toArray(new String[0]);
Arrays.sort(keys);
StringBuilder stringBuilder = new StringBuilder();
for (String key : keys) {
stringBuilder.append(key).append(map.get(key));
}
stringBuilder.append("mySecret123456");
log.info(DigestUtils.md5Hex(stringBuilder.toString()));
去掉<String, String>和<>
Map map = new HashMap();
这样写就不会报错了
标签:11,map,HashMap,Map,column,stringBuilder,Encountered,new,import From: https://blog.51cto.com/u_15694134/5935201