TIntIntMapDecorator allows for NPE when passed in map object is null

Issue #66 resolved
Ilya Medvedev created an issue

Using 3.03, if I call TDecorators.wrap(myMap) on a null map and then call .get(key) on the Map I will get an uncaught NPE. I am pretty sure that .put() and other calls inside of the TIntIntMapDecorator will also result in NPEs.

Sample stack trace sample:

java.lang.NullPointerException
    at gnu.trove.decorator.TIntIntMapDecorator.get(TIntIntMapDecorator.java:132)
    at gnu.trove.decorator.TIntIntMapDecorator.get(TIntIntMapDecorator.java:50)

This was very difficult to troubleshoot as the actual Map<A,B> object that is returned by TDecorators.wrap is Not null.

Comments (3)

  1. Jim Davies

    Fixed for map, set and list decorators. Now fails fast with an NPF if you pass in a null reference for a collection.

  2. Log in to comment