Skip to content

Commit 79331c4

Browse files
author
Peter Alfonsi
committed
Initialize CommonStatsFlags with empty array for levels
Signed-off-by: Peter Alfonsi <petealft@amazon.com>
1 parent 8b837aa commit 79331c4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server/src/main/java/org/opensearch/action/admin/indices/stats/CommonStatsFlags.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public class CommonStatsFlags implements Writeable, Cloneable {
6666
private boolean includeOnlyTopIndexingPressureMetrics = false;
6767
// Used for metric CACHE_STATS, to determine which caches to report stats for
6868
private EnumSet<CacheType> includeCaches = EnumSet.noneOf(CacheType.class);
69-
private String[] levels;
69+
private String[] levels = new String[0];
7070

7171
/**
7272
* @param flags flags to set. If no flags are supplied, default flags will be set.
@@ -139,7 +139,7 @@ public CommonStatsFlags all() {
139139
includeAllShardIndexingPressureTrackers = false;
140140
includeOnlyTopIndexingPressureMetrics = false;
141141
includeCaches = EnumSet.noneOf(CacheType.class);
142-
levels = null;
142+
levels = new String[0];
143143
return this;
144144
}
145145

@@ -156,7 +156,7 @@ public CommonStatsFlags clear() {
156156
includeAllShardIndexingPressureTrackers = false;
157157
includeOnlyTopIndexingPressureMetrics = false;
158158
includeCaches = EnumSet.noneOf(CacheType.class);
159-
levels = null;
159+
levels = new String[0];
160160
return this;
161161
}
162162

0 commit comments

Comments
 (0)