Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 28799 invoked from network); 6 Jun 2007 15:25:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Jun 2007 15:25:53 -0000 Received: (qmail 94452 invoked by uid 500); 6 Jun 2007 15:25:51 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 94405 invoked by uid 500); 6 Jun 2007 15:25:51 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: 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 94385 invoked by uid 99); 6 Jun 2007 15:25:51 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jun 2007 08:25:51 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jun 2007 08:25:46 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 54ED1714199 for ; Wed, 6 Jun 2007 08:25:26 -0700 (PDT) Message-ID: <754898.1181143526345.JavaMail.jira@brutus> Date: Wed, 6 Jun 2007 08:25:26 -0700 (PDT) From: "Henri Yandell (JIRA)" To: commons-dev@jakarta.apache.org Subject: [jira] Updated: (LANG-334) Enum is not thread-safe In-Reply-To: <9190250.1179181936485.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LANG-334?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Henri Yandell updated LANG-334: ------------------------------- Attachment: EnumPlay.java I made an attempt at a test, but it couldn't replicate the issue. > Enum is not thread-safe > ----------------------- > > Key: LANG-334 > URL: https://issues.apache.org/jira/browse/LANG-334 > Project: Commons Lang > Issue Type: Bug > Reporter: Michael Sclafani > Fix For: 2.3.1 > > Attachments: EnumPlay.java > > > Enum uses no synchronization. Even if you assume that instances are only declared statically, the cEnumClasses map is global and can be written to when a thread triggers static initialization of B.class while some other thread is doing getEnumList(A.class). Unsynchronized access of a map undergoing mutation is not thread-safe. > This isn't theoretical. We're seeing ValuedEnum.getEnum(X.class, 0) return null after returning the correct value over 100,000 times, and then return the correct value again on the next invocation. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org