Sascha Brawer wrote:
> * Returns true if there are no key-value mappings currently in this table.
> * @return <code>size() == 0</code>
> */
> - public synchronized boolean isEmpty()
> + public boolean isEmpty()
> {
> + /* This method does not need to be synchronized
> + * because accessing an integer field is atomic.
> + */
> return size == 0;
> }
If we are on the subject, I think it should check for
size() == 0
, not
size == 0
as subclasses would rather think that overriding size() is enough, not
caring about overriding isEmpty(). Either that, or change the javadoc,
but I think that size() == 0 would be more in line with sun spec - and
OO-progamming in general :)
Artur
_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath