Skip to content

Commit 84c67c8

Browse files
committed
Inline these initializations
1 parent 2d2dd9d commit 84c67c8

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/DocumentSubsetBitsetCache.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ public final class DocumentSubsetBitsetCache implements IndexReader.ClosedListen
125125
private final Cache<BitsetCacheKey, BitSet> bitsetCache;
126126
private final Map<IndexReader.CacheKey, Set<BitsetCacheKey>> keysByIndex;
127127
private final AtomicLong cacheFullWarningTime;
128-
private final LongAdder hitsTimeInNanos;
129-
private final LongAdder missesTimeInNanos;
128+
private final LongAdder hitsTimeInNanos = new LongAdder();
129+
private final LongAdder missesTimeInNanos = new LongAdder();
130130
private final LongSupplier relativeNanoTimeProvider;
131131

132132
public DocumentSubsetBitsetCache(Settings settings, ThreadPool threadPool) {
@@ -162,8 +162,6 @@ public DocumentSubsetBitsetCache(Settings settings, ThreadPool threadPool) {
162162

163163
this.keysByIndex = new ConcurrentHashMap<>();
164164
this.cacheFullWarningTime = new AtomicLong(0);
165-
this.hitsTimeInNanos = new LongAdder();
166-
this.missesTimeInNanos = new LongAdder();
167165
this.relativeNanoTimeProvider = Objects.requireNonNull(relativeNanoTimeProvider);
168166
}
169167

0 commit comments

Comments
 (0)