今早一过来就遇到一个bug,result.setData数据没写入成功,具体代码如下:
result.setData(new HashMap<>().put("stepType",stepType));
debug后发现data中的数据是null;查hashMap源码:
public HashMap() {
this.loadFactor = DEFAULT_LOAD_FACTOR; // all other fields defaulted
}
创建对象没啥问题,下一步查put的源码:
/**
* Associates the specified value with the specified key in this map.
* If the map previously contained a mapping for the key, the old
* value is replaced.
*
* @param key key with which the specified value is to be associated
* @param value value to be associated with the specified key
* @return the previous value associated with <tt>key</tt>, or
* <tt>nu