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 2020/06/09 12:01:09 UTC

[skywalking] branch readHeatMap created (now 2e6e1b3)

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

tanjian pushed a change to branch readHeatMap
in repository https://gitbox.apache.org/repos/asf/skywalking.git.


      at 2e6e1b3  fix NPE when fetch empty readHeatMap metrics.

This branch includes the following new commits:

     new 2e6e1b3  fix NPE when fetch empty readHeatMap metrics.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[skywalking] 01/01: fix NPE when fetch empty readHeatMap metrics.

Posted by ta...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 2e6e1b3ce9170461933d65224e53024e0927042b
Author: JaredTan95 <ji...@daocloud.io>
AuthorDate: Tue Jun 9 20:00:31 2020 +0800

    fix NPE when fetch empty readHeatMap metrics.
---
 .../org/apache/skywalking/oap/server/core/query/type/HeatMap.java    | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/type/HeatMap.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/type/HeatMap.java
index 8483e19..d8b11c1 100644
--- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/type/HeatMap.java
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/type/HeatMap.java
@@ -34,7 +34,7 @@ import org.apache.skywalking.oap.server.core.analysis.metrics.DataTable;
 @Getter
 public class HeatMap {
     private List<HeatMapColumn> values = new ArrayList<>(10);
-    private List<Bucket> buckets = null;
+    private List<Bucket> buckets = new ArrayList<>();
 
     public void addBucket(Bucket bucket) {
         this.buckets.add(bucket);
@@ -50,8 +50,7 @@ public class HeatMap {
         DataTable dataset = new DataTable(rawdata);
 
         final List<String> sortedKeys = dataset.sortedKeys(new KeyComparator(true));
-        if (buckets == null) {
-            buckets = new ArrayList<>(dataset.size());
+        if (buckets.isEmpty()) {
             for (int i = 0; i < sortedKeys.size(); i++) {
                 final Bucket bucket = new Bucket();
                 final String minValue = sortedKeys.get(i);