Description
The JavaDocs for IoSession.getAttribute(Object key, Object defaultValue) state that if the key doesn't exist yet, the default value is stored in the map.
http://mina.apache.org/report/trunk/apidocs/org/apache/mina/core/session/IoSession.html#getAttribute(java.lang.Object, java.lang.Object)
The actual implementation (in DefaultIoSessionAttributeMap) reads
public Object getAttribute(IoSession session, Object key, Object defaultValue) { if (key == null) { throw new IllegalArgumentException("key"); } Object answer = attributes.get(key); if (answer == null) { return defaultValue; } return answer; }
It never stores the default value.
Can you (preferably) fix that, or (less preferably) correct the JavaDoc?