优化代码

* 错别字

* long l->L

* 使xml中不存在的属性不会把java bean中已有的属性覆盖成null
比如:me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage#accessTokenLock
This commit is contained in:
627535195 2018-03-09 22:34:38 +08:00 committed by Binary Wang
parent ee3be3b33c
commit 58dec7bf08
2 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,7 @@
package me.chanjar.weixin.common.util.xml;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider;
import com.thoughtworks.xstream.core.util.QuickWriter;
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
import com.thoughtworks.xstream.io.xml.PrettyPrintWriter;
@ -13,7 +14,7 @@ import java.io.Writer;
public class XStreamInitializer {
public static XStream getInstance() {
XStream xstream = new XStream(new XppDriver() {
XStream xstream = new XStream(new PureJavaReflectionProvider(), new XppDriver() {
@Override
public HierarchicalStreamWriter createWriter(Writer out) {
@ -42,6 +43,7 @@ public class XStreamInitializer {
};
}
});
xstream.ignoreUnknownElements();
xstream.setMode(XStream.NO_REFERENCES);
xstream.addPermission(NullPermission.NULL);

View File

@ -90,7 +90,7 @@ public interface WxMpService {
* 获取access_token本方法线程安全
* 且在多线程同时刷新时只刷新一次避免超出2000次/日的调用次数上限
*
* 本service的所有方法都会在access_token过期调用此方法
* 本service的所有方法都会在access_token过期调用此方法
*
* 程序员在非必要情况下尽量不要主动调用此方法
*