FYI: Patch: java.util.Hashtable

Dalibor Topic robilad@kaffe.org
Sun Dec 7 19:02:00 GMT 2003


Hi Bryce,

Bryce McKinlay wrote:
> Hi,
> 
>> +2003-12-02  Dalibor Topic <robilad@kaffe.org>
>> +
>> +    Reported by: Jim Pick <jim@kaffe.org>
>> +    * libraries/javalib/java/util/Hashtable.java
>> +    (internalcontainsValue): New method.
>> +    (contains): Delegate to internalContainsValue.
>> +   
> 
> 
>>    public synchronized boolean contains(Object value)
>>    {
>> -    return containsValue(value);
>> +    /* delegate to non-overridable worker method
>> +     * to avoid blowing up the stack, when called
>> +     * from overridden contains[Value]() method.
>> +     */
>> +    return internalContainsValue(value);
>>    }
> 
> 
> Can you (Jim/Dalibor) explain what this change achieves? I understand 
> reversing the delegation order between contains() & containsValue(), but 
> why add an internal private method? It doesn't affect the overriding 
> behaviour of containsValue() at all - or am I missing something

The new method is not strictly necessary. It was there to make patching 
easier until we figured out the proper delegation chain for contains*(). 
Feel free to inline it back into contains().

cheers,
dalibor topic



More information about the Java-patches mailing list