Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 2598 invoked from network); 18 Nov 2009 19:03:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 18 Nov 2009 19:03:53 -0000 Received: (qmail 3545 invoked by uid 500); 18 Nov 2009 19:03:53 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 3474 invoked by uid 500); 18 Nov 2009 19:03:53 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 3465 invoked by uid 99); 18 Nov 2009 19:03:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Nov 2009 19:03:53 +0000 X-ASF-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Nov 2009 19:03:50 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9E76E23888C2; Wed, 18 Nov 2009 19:03:30 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r881880 - /geronimo/specs/trunk/geronimo-el_1.0_spec/src/main/java/javax/el/CompositeELResolver.java Date: Wed, 18 Nov 2009 19:03:30 -0000 To: scm@geronimo.apache.org From: kevan@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091118190330.9E76E23888C2@eris.apache.org> Author: kevan Date: Wed Nov 18 19:03:30 2009 New Revision: 881880 URL: http://svn.apache.org/viewvc?rev=881880&view=rev Log: GERONIMO-4957 Add some synchronization to CompositeELResolver. Synchronizing add() would probably fix the problem. For strict correctness, the additional synchronization is needed Modified: geronimo/specs/trunk/geronimo-el_1.0_spec/src/main/java/javax/el/CompositeELResolver.java Modified: geronimo/specs/trunk/geronimo-el_1.0_spec/src/main/java/javax/el/CompositeELResolver.java URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-el_1.0_spec/src/main/java/javax/el/CompositeELResolver.java?rev=881880&r1=881879&r2=881880&view=diff ============================================================================== --- geronimo/specs/trunk/geronimo-el_1.0_spec/src/main/java/javax/el/CompositeELResolver.java (original) +++ geronimo/specs/trunk/geronimo-el_1.0_spec/src/main/java/javax/el/CompositeELResolver.java Wed Nov 18 19:03:30 2009 @@ -31,7 +31,7 @@ this.resolvers = new ELResolver[2]; } - public void add(ELResolver elResolver) { + synchronized public void add(ELResolver elResolver) { if (elResolver == null) { throw new NullPointerException(); } @@ -47,10 +47,15 @@ public Object getValue(ELContext context, Object base, Object property) throws NullPointerException, PropertyNotFoundException, ELException { context.setPropertyResolved(false); - int sz = this.size; + int sz; + ELResolver[] rslvrs; + synchronized (this) { + sz = this.size; + rslvrs = this.resolvers; + } Object result = null; for (int i = 0; i < sz; i++) { - result = this.resolvers[i].getValue(context, base, property); + result = rslvrs[i].getValue(context, base, property); if (context.isPropertyResolved()) { return result; } @@ -63,9 +68,14 @@ PropertyNotFoundException, PropertyNotWritableException, ELException { context.setPropertyResolved(false); - int sz = this.size; + int sz; + ELResolver[] rslvrs; + synchronized (this) { + sz = this.size; + rslvrs = this.resolvers; + } for (int i = 0; i < sz; i++) { - this.resolvers[i].setValue(context, base, property, value); + rslvrs[i].setValue(context, base, property, value); if (context.isPropertyResolved()) { return; } @@ -75,10 +85,15 @@ public boolean isReadOnly(ELContext context, Object base, Object property) throws NullPointerException, PropertyNotFoundException, ELException { context.setPropertyResolved(false); - int sz = this.size; + int sz; + ELResolver[] rslvrs; + synchronized (this) { + sz = this.size; + rslvrs = this.resolvers; + } boolean readOnly = false; for (int i = 0; i < sz; i++) { - readOnly = this.resolvers[i].isReadOnly(context, base, property); + readOnly = rslvrs[i].isReadOnly(context, base, property); if (context.isPropertyResolved()) { return readOnly; } @@ -86,15 +101,20 @@ return false; } - public Iterator getFeatureDescriptors(ELContext context, Object base) { + synchronized public Iterator getFeatureDescriptors(ELContext context, Object base) { return new FeatureIterator(context, base, this.resolvers, this.size); } public Class getCommonPropertyType(ELContext context, Object base) { - int sz = this.size; + int sz; + ELResolver[] rslvrs; + synchronized (this) { + sz = this.size; + rslvrs = this.resolvers; + } Class commonType = null, type = null; for (int i = 0; i < sz; i++) { - type = this.resolvers[i].getCommonPropertyType(context, base); + type = rslvrs[i].getCommonPropertyType(context, base); if (type != null && (commonType == null || commonType.isAssignableFrom(type))) { commonType = type; @@ -106,10 +126,15 @@ public Class getType(ELContext context, Object base, Object property) throws NullPointerException, PropertyNotFoundException, ELException { context.setPropertyResolved(false); - int sz = this.size; + int sz; + ELResolver[] rslvrs; + synchronized (this) { + sz = this.size; + rslvrs = this.resolvers; + } Class type; for (int i = 0; i < sz; i++) { - type = this.resolvers[i].getType(context, base, property); + type = rslvrs[i].getType(context, base, property); if (context.isPropertyResolved()) { return type; }