Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
When indexing map fields that have null keys, geode throws an NPE.
Steps to reproduce:
1. Create an index on a map field eg
create index --name="idx_positions" --expression="positions[*]" --region="region"
2. Add entries with null keys in the the indexed map
entry.positions = new HashMap() entry.positions.put(null, "somevalue); region.put(entry);
You will get an NPE
Caused by: java.lang.NullPointerException at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936) at com.gemstone.gemfire.cache.query.internal.index.CompactMapRangeIndex.saveIndexAddition(CompactMapRangeIndex.java:184) at com.gemstone.gemfire.cache.query.internal.index.CompactMapRangeIndex.saveMapping(CompactMapRangeIndex.java:111) at com.gemstone.gemfire.cache.query.internal.index.AbstractIndex$IMQEvaluator.applyProjection(AbstractIndex.java:1354) at com.gemstone.gemfire.cache.query.internal.index.AbstractIndex$IMQEvaluator.doNestedIterations(AbstractIndex.java:1304) at com.gemstone.gemfire.cache.query.internal.index.AbstractIndex$IMQEvaluator.doNestedIterations(AbstractIndex.java:1315) at com.gemstone.gemfire.cache.query.internal.index.AbstractIndex$IMQEvaluator.evaluate(AbstractIndex.java:1132) ... 44 more