You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ta...@apache.org on 2019/01/12 04:01:15 UTC

[incubator-skywalking] branch master updated: Fix unessential gson instance (#2151)

This is an automated email from the ASF dual-hosted git repository.

tanjian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking.git


The following commit(s) were added to refs/heads/master by this push:
     new f9fb693  Fix unessential gson instance (#2151)
f9fb693 is described below

commit f9fb69336e7d265650c7d4e6a7a22773317f4884
Author: Yann.Xia <me...@yannxia.info>
AuthorDate: Sat Jan 12 12:01:11 2019 +0800

    Fix unessential gson instance (#2151)
---
 .../apache/skywalking/oap/server/core/register/ServiceInventory.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/ServiceInventory.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/ServiceInventory.java
index 676ba52..9aaa37b 100644
--- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/ServiceInventory.java
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/register/ServiceInventory.java
@@ -48,6 +48,7 @@ public class ServiceInventory extends RegisterSource {
     public static final String MAPPING_SERVICE_ID = "mapping_service_id";
     public static final String MAPPING_LAST_UPDATE_TIME = "mapping_last_update_time";
     public static final String PROPERTIES = "properties";
+    private static final Gson GSON = new Gson();
 
     @Setter @Getter @Column(columnName = NAME, matchQuery = true) private String name = Const.EMPTY_STRING;
     @Setter @Getter @Column(columnName = IS_ADDRESS) private int isAddress;
@@ -100,7 +101,7 @@ public class ServiceInventory extends RegisterSource {
     private void setProp(String prop) {
         this.prop = prop;
         if (!Strings.isNullOrEmpty(prop)) {
-            this.properties = new Gson().fromJson(prop, JsonObject.class);
+            this.properties = GSON.fromJson(prop, JsonObject.class);
         }
     }