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

[GitHub] JaredTan95 closed pull request #2151: Improve unessential gson instance

JaredTan95 closed pull request #2151: Improve unessential gson instance
URL: https://github.com/apache/incubator-skywalking/pull/2151
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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 676ba52b5e..9aaa37be0e 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 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 void setProperties(JsonObject properties) {
     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);
         }
     }
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services