dictionary - java.lang.NegativeArraySizeException with WeakHashMap keySet -


i have following code:

 public synchronized static arraylist<httpsession> getcurrentsessionlist() {       return new arraylist<httpsession>(sessions.keyset());    } 

we have client getting java.lang.negativearraysizeexception list initialised values of keys map sessions. unable replicate it. using openjdk 7 build 71, on linux.

sessions weakhashmap assume causing issue. understand creating new list create hard-reference items in maps, short lived , used reporting on contents of map.

the reason arraylist created items can manipulated in loops etc., without having worry items in weakhashmap disappearing.

can suggest safe way of initialising list?


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -