You should not use string literals with WeakHashMap (well you can, but that wouldn't make sense):
String myKey = "somekey";
instead you should use:
String myKey = new String("somekey");
In the latter case, String is not combined.
Peter Knego
source share