geode-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (GEODE-3982) MemoryIndexStoreIterator should not call GemFireCacheImpl.getInstance
Date Fri, 17 Nov 2017 20:39:00 GMT


ASF GitHub Bot commented on GEODE-3982:

jhuynh1 closed pull request #1064: GEODE-3982: MemoryIndexStoreIterator should not call GemFireCacheImpl

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/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/
index 21f5a167ce..116262b1c4 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/
@@ -612,7 +612,7 @@ public MemoryIndexStoreKey next() {
     MemoryIndexStoreEntry currentEntry;
     MemoryIndexStoreIterator(Map submap, Object indexKey, Collection keysToRemove) {
-      this(submap, indexKey, keysToRemove, GemFireCacheImpl.getInstance().cacheTimeMillis());
+      this(submap, indexKey, keysToRemove, cache.cacheTimeMillis());
     private MemoryIndexStoreIterator(Map submap, Object indexKey, Collection keysToRemove,
diff --git a/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/
index cc8e3fd48c..873c67a4a2 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/
+++ b/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/
@@ -74,6 +74,12 @@ public void teardown() {
+  @Test
+  public void createIteratorWhenCacheNulledWhenShuttingDownShouldNotThrowNPE() {
+    GemFireCacheImpl.setInstanceForTests(null);
+    store.get("T");
+  }
   public void testSizeOfStoreReturnsNumberOfKeysAndNotActualNumberOfValues() {
     IntStream.range(0, 150).forEach(i -> {


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:

> MemoryIndexStoreIterator should not call GemFireCacheImpl.getInstance
> ---------------------------------------------------------------------
>                 Key: GEODE-3982
>                 URL:
>             Project: Geode
>          Issue Type: Bug
>          Components: querying
>            Reporter: Jason Huynh
>            Assignee: Jason Huynh
> This call should be removed from the constructor and instead be passed in.  There is
already a handle to the cache from the memory index store itself.  
> The current call can also lead to an NPE when the cache is closing and query is executed.

This message was sent by Atlassian JIRA

View raw message