diff --git a/docs/ReleaseNotes.html b/docs/ReleaseNotes.html index 4b7c681..b2bf6b5 100644 --- a/docs/ReleaseNotes.html +++ b/docs/ReleaseNotes.html @@ -25,7 +25,7 @@ 1504120 Microsoft 2003 Server crashes. Server crashes on MS 2003 Server have been reported over time. Some users have had say that Jacob must be built on MS2003 Server to run reliably. - The Jacob distribution on Sourceforge is built on Windows XP SP2. + The Jacob distribution on Sourceforge is built on Windows XP SP2 (this item is soley informationional)   @@ -34,6 +34,12 @@ Patches + + 1674015 + ROT hashmap handling when autogc=no (default) can lead to key collisions + in hashmap. This causes objects to be garbage finalized when they shouldn't be resulting in vm failures + with large (large) numbers of objects. +     diff --git a/src/com/jacob/com/ROT.java b/src/com/jacob/com/ROT.java index b2415de..75c9e40 100644 --- a/src/com/jacob/com/ROT.java +++ b/src/com/jacob/com/ROT.java @@ -112,12 +112,7 @@ public abstract class ROT { JacobObject.debug( "ROT: " + tab.keySet().size() + " objects to clear in this thread " ); } // walk the values - Iterator it; - if ( USE_AUTOMATIC_GARBAGE_COLLECTION ) { - it = tab.keySet().iterator(); - } else { - it = tab.values().iterator(); - } + Iterator it = tab.keySet().iterator(); while ( it.hasNext() ) { JacobObject o = (JacobObject) it.next(); if ( o != null @@ -153,34 +148,6 @@ public abstract class ROT { } } - /** - * generates the key used to insert object into the thread's list of objects. - * @param targetMap the map we need the key for. Used to make sure we create a compatabile key - * @param o JacobObject we need key for - * @return some key compatabile with hashmaps - */ - protected static Object getMapKey( Map targetMap, JacobObject o ) { - if ( targetMap instanceof WeakHashMap ) { - return o; - } else { - return new Integer( o.hashCode() ); - } - } - - /** - * generates the object used to insert object into the thread's list of objects. - * @param targetMap the map we need the key for. Used to make sure we create a compatabile key - * @param o JacobObject we need key for - * @return some compatabile with hashmaps (null for weak has map) - */ - protected static Object getMapValue( Map targetMap, JacobObject o ) { - if ( targetMap instanceof WeakHashMap ) { - return null; - } else { - return o; - } - } - /** * @deprecated the java model leave the responsibility of clearing up objects * to the Garbage Collector. Our programming model should not require that the @@ -193,7 +160,7 @@ public abstract class ROT { String t_name = Thread.currentThread().getName(); Map tab = (Map) rot.get( t_name ); if ( tab != null ) { - tab.remove( getMapKey( tab, o ) ); + tab.remove( o ); } o.safeRelease(); } @@ -216,7 +183,7 @@ public abstract class ROT { " table size prior to addition:" + tab.size() ); } if ( tab != null ) { - tab.put( getMapKey( tab, o ), getMapValue( tab, o ) ); + tab.put( o, null ); } }