Github user robertdale commented on the issue:

    https://github.com/apache/tinkerpop/pull/745
  
    @mpollmeier Sorry, I thought that `putIfAbsent()` returned the current map 
but it returns old mapping or `null` hence the `NPEs`.  Should be:
    ```java
        protected void put(final String key, final Object value, final T 
element) {
            Map<Object, Set<T>> keyMap = this.index.get(key);
            if (null == keyMap) {
                Map<Object, Set<T>> tmpMap = new ConcurrentHashMap<>();
                this.index.putIfAbsent(key, tmpMap);
                keyMap = this.index.get(key);
            }
            Set<T> objects = keyMap.get(value);
            if (null == objects) {
                Set<T> tmpObjects = ConcurrentHashMap.newKeySet();
                keyMap.putIfAbsent(value, tmpObjects);
                objects = keyMap.get(value);
            }
            objects.add(element);
        }
    ``` 


---

Reply via email to