geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jasonhu...@apache.org
Subject [geode] branch develop updated: GEODE-3982: MemoryIndexStoreIterator should not call GemFireCacheImpl (#1064)
Date Fri, 17 Nov 2017 20:38:51 GMT
This is an automated email from the ASF dual-hosted git repository.

jasonhuynh pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 245a4ff  GEODE-3982: MemoryIndexStoreIterator should not call GemFireCacheImpl (#1064)
245a4ff is described below

commit 245a4ff25195ffde2f7a5fefbcba4ac86fa89e82
Author: Jason Huynh <huynhja@gmail.com>
AuthorDate: Fri Nov 17 12:38:49 2017 -0800

    GEODE-3982: MemoryIndexStoreIterator should not call GemFireCacheImpl (#1064)
---
 .../apache/geode/cache/query/internal/index/MemoryIndexStore.java   | 2 +-
 .../geode/cache/query/internal/index/MemoryIndexStoreJUnitTest.java | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/MemoryIndexStore.java
b/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/MemoryIndexStore.java
index 21f5a16..116262b 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/MemoryIndexStore.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/MemoryIndexStore.java
@@ -612,7 +612,7 @@ public class MemoryIndexStore implements IndexStore {
     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/MemoryIndexStoreJUnitTest.java
b/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/MemoryIndexStoreJUnitTest.java
index cc8e3fd..873c67a 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/MemoryIndexStoreJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/MemoryIndexStoreJUnitTest.java
@@ -75,6 +75,12 @@ public class MemoryIndexStoreJUnitTest {
   }
 
   @Test
+  public void createIteratorWhenCacheNulledWhenShuttingDownShouldNotThrowNPE() {
+    GemFireCacheImpl.setInstanceForTests(null);
+    store.get("T");
+  }
+
+  @Test
   public void testSizeOfStoreReturnsNumberOfKeysAndNotActualNumberOfValues() {
     IntStream.range(0, 150).forEach(i -> {
       try {

-- 
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <commits@geode.apache.org>'].

Mime
View raw message