mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-08-25 01:14:36 +08:00
优化代码
* 错别字 * long l->L * 使xml中不存在的属性不会把java bean中已有的属性覆盖成null 比如:me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage#accessTokenLock
This commit is contained in:
parent
ee3be3b33c
commit
58dec7bf08
@ -1,6 +1,7 @@
|
|||||||
package me.chanjar.weixin.common.util.xml;
|
package me.chanjar.weixin.common.util.xml;
|
||||||
|
|
||||||
import com.thoughtworks.xstream.XStream;
|
import com.thoughtworks.xstream.XStream;
|
||||||
|
import com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider;
|
||||||
import com.thoughtworks.xstream.core.util.QuickWriter;
|
import com.thoughtworks.xstream.core.util.QuickWriter;
|
||||||
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
|
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
|
||||||
import com.thoughtworks.xstream.io.xml.PrettyPrintWriter;
|
import com.thoughtworks.xstream.io.xml.PrettyPrintWriter;
|
||||||
@ -13,7 +14,7 @@ import java.io.Writer;
|
|||||||
public class XStreamInitializer {
|
public class XStreamInitializer {
|
||||||
|
|
||||||
public static XStream getInstance() {
|
public static XStream getInstance() {
|
||||||
XStream xstream = new XStream(new XppDriver() {
|
XStream xstream = new XStream(new PureJavaReflectionProvider(), new XppDriver() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HierarchicalStreamWriter createWriter(Writer out) {
|
public HierarchicalStreamWriter createWriter(Writer out) {
|
||||||
@ -42,6 +43,7 @@ public class XStreamInitializer {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
xstream.ignoreUnknownElements();
|
xstream.ignoreUnknownElements();
|
||||||
xstream.setMode(XStream.NO_REFERENCES);
|
xstream.setMode(XStream.NO_REFERENCES);
|
||||||
xstream.addPermission(NullPermission.NULL);
|
xstream.addPermission(NullPermission.NULL);
|
||||||
|
@ -90,7 +90,7 @@ public interface WxMpService {
|
|||||||
* 获取access_token,本方法线程安全
|
* 获取access_token,本方法线程安全
|
||||||
* 且在多线程同时刷新时只刷新一次,避免超出2000次/日的调用次数上限
|
* 且在多线程同时刷新时只刷新一次,避免超出2000次/日的调用次数上限
|
||||||
*
|
*
|
||||||
* 另:本service的所有方法都会在access_token过期是调用此方法
|
* 另:本service的所有方法都会在access_token过期时调用此方法
|
||||||
*
|
*
|
||||||
* 程序员在非必要情况下尽量不要主动调用此方法
|
* 程序员在非必要情况下尽量不要主动调用此方法
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user