It may be accessed by multiple threads so please use ConcurrentHashMap or use a volatile field and instead of a simple put, copy a map, add item to it and change the field to reference the copy. The latter is probably better since the cache will be modified rarely.