You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2023/03/23 10:06:32 UTC

[skywalking] branch fix created (now 6c1350c520)

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

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


      at 6c1350c520 Fix possible NPE when initialize `IntList`.

This branch includes the following new commits:

     new 6c1350c520 Fix possible NPE when initialize `IntList`.

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 possible NPE when initialize `IntList`.

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

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

commit 6c1350c520a9e4c28cbbced78322b242c7ff314b
Author: Wu Sheng <wu...@foxmail.com>
AuthorDate: Thu Mar 23 18:06:12 2023 +0800

    Fix possible NPE when initialize `IntList`.
---
 docs/en/changes/changes.md                                           | 1 +
 .../apache/skywalking/oap/server/core/analysis/metrics/IntList.java  | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/docs/en/changes/changes.md b/docs/en/changes/changes.md
index 1a2ca979c8..55498f22b1 100644
--- a/docs/en/changes/changes.md
+++ b/docs/en/changes/changes.md
@@ -19,6 +19,7 @@
 * Fix K8sRetag reads the wrong k8s service from the cache due to a possible namespace mismatch.
 * [Breaking Change] Support cross-thread trace profiling. The data structure and query APIs are changed.
 * Fix PromQL HTTP API `/api/v1/labels` response missing `service` label.
+* Fix possible NPE when initialize `IntList`.
 
 #### UI
 * Revert: cpm5d function. This feature is cancelled from backend.
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/metrics/IntList.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/metrics/IntList.java
index 7315b9d31a..33b07272eb 100644
--- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/metrics/IntList.java
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/metrics/IntList.java
@@ -24,6 +24,7 @@ import lombok.EqualsAndHashCode;
 import lombok.ToString;
 import org.apache.skywalking.oap.server.core.Const;
 import org.apache.skywalking.oap.server.core.storage.type.StorageDataComplexObject;
+import org.apache.skywalking.oap.server.library.util.StringUtil;
 
 /**
  * IntList is a serializable array list carrying int values.
@@ -65,6 +66,10 @@ public class IntList implements StorageDataComplexObject<IntList> {
 
     @Override
     public void toObject(final String data) {
+        if (StringUtil.isBlank(data)) {
+            this.data = new ArrayList<>(3);
+            return;
+        }
         String[] elements = data.split(Const.ARRAY_PARSER_SPLIT);
         this.data = new ArrayList<>(elements.length);
         for (String element : elements) {