Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 21262 invoked from network); 24 Jan 2002 22:28:27 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 24 Jan 2002 22:28:27 -0000 Received: (qmail 20791 invoked by uid 97); 24 Jan 2002 22:28:31 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 20761 invoked by uid 97); 24 Jan 2002 22:28:30 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 20741 invoked from network); 24 Jan 2002 22:28:30 -0000 Message-ID: <20020124222829.14140.qmail@web20903.mail.yahoo.com> Date: Thu, 24 Jan 2002 22:28:29 +0000 (GMT) From: =?iso-8859-1?q?Janek=20Bogucki?= Subject: SequencedHashMap: This class is thread-safe (was Re: Silly Question) To: Jakarta Commons Developers List In-Reply-To: <3C5072C9.C0F43363@collab.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi John, --- John McNally wrote: > > > Remove the "This class is thread-safe" declaration > in SequencedHashMap. When I first read this class through I thought I'd spotted a race condition in freshenSequence but a rethink convinced me it was not thread-unsafe. Am I wrong here? If not, what's the actual location of the non thread-safe behaviour? -Janek /** * Freshens the sequence of the element value if * value is not null. * * @param key The key whose sequence to freshen. * @param value The value whose existance to check before removing the old * key sequence. */ protected void freshenSequence(Object key, Object value) { if (value != null) { // Freshening existing element's sequence. keySequence.remove(key); } keySequence.add(key); } __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- To unsubscribe, e-mail: For additional commands, e-mail: