[concurrency-interest] Javadoc for offer method in ConcurrentLinkedQueue

David Holmes dholmes@dltech.com.au
Thu, 11 Sep 2003 22:05:35 +1000


Kasper Nielsen wrote:
> It seems as the javadoc for the offer method has just been
> copied from the Queue interface. What it makes it look like is that
> there is some kind of difference between the add-method and
offer-method
> because the later may return false if the offer didn't succed.

I don't understand what you perceive as the problem. The javadoc for
offer() hasn't been copied, it's been redefined to indicate that the
offer can't fail (ie return false). For an unbounded collection
offer() and add() have the same behaviour as they differ only in the
failure mode related to capacity restrictions.

David Holmes