mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-08-24 16:18:51 +08:00
🎨 fix GsonBuilder singleton NPE
This commit is contained in:
parent
ee17a5ee6f
commit
0601e8fb17
@ -29,7 +29,7 @@ public class WxGsonBuilder {
|
||||
|
||||
public static Gson create() {
|
||||
if (Objects.isNull(GSON_INSTANCE)) {
|
||||
synchronized (GSON_INSTANCE) {
|
||||
synchronized (INSTANCE) {
|
||||
if (Objects.isNull(GSON_INSTANCE)) {
|
||||
GSON_INSTANCE = INSTANCE.create();
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ public class WxCpGsonBuilder {
|
||||
|
||||
public static Gson create() {
|
||||
if (Objects.isNull(GSON_INSTANCE)) {
|
||||
synchronized (GSON_INSTANCE) {
|
||||
synchronized (INSTANCE) {
|
||||
if (Objects.isNull(GSON_INSTANCE)) {
|
||||
GSON_INSTANCE = INSTANCE.create();
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ public class WxMaGsonBuilder {
|
||||
|
||||
public static Gson create() {
|
||||
if (Objects.isNull(GSON_INSTANCE)) {
|
||||
synchronized (GSON_INSTANCE) {
|
||||
synchronized (INSTANCE) {
|
||||
if (Objects.isNull(GSON_INSTANCE)) {
|
||||
GSON_INSTANCE = INSTANCE.create();
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ public class WxMpGsonBuilder {
|
||||
|
||||
public static Gson create() {
|
||||
if (Objects.isNull(GSON_INSTANCE)) {
|
||||
synchronized (GSON_INSTANCE) {
|
||||
synchronized (INSTANCE) {
|
||||
if (Objects.isNull(GSON_INSTANCE)) {
|
||||
GSON_INSTANCE = INSTANCE.create();
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ public class WxOpenGsonBuilder {
|
||||
|
||||
public static Gson create() {
|
||||
if (Objects.isNull(GSON_INSTANCE)) {
|
||||
synchronized (GSON_INSTANCE) {
|
||||
synchronized (INSTANCE) {
|
||||
if (Objects.isNull(GSON_INSTANCE)) {
|
||||
GSON_INSTANCE = INSTANCE.create();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user