Return-Path: X-Original-To: apmail-geronimo-scm-archive@www.apache.org Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0744E9D34 for ; Wed, 18 Apr 2012 22:43:56 +0000 (UTC) Received: (qmail 67728 invoked by uid 500); 18 Apr 2012 22:43:55 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 67683 invoked by uid 500); 18 Apr 2012 22:43:55 -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 67675 invoked by uid 99); 18 Apr 2012 22:43:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Apr 2012 22:43:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED 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 Apr 2012 22:43:52 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 82C542388860; Wed, 18 Apr 2012 22:43:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1327712 - /geronimo/specs/trunk/geronimo-el_2.2_spec/src/main/java/javax/el/CompositeELResolver.java Date: Wed, 18 Apr 2012 22:43:31 -0000 To: scm@geronimo.apache.org From: gawor@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120418224331.82C542388860@eris.apache.org> Author: gawor Date: Wed Apr 18 22:43:31 2012 New Revision: 1327712 URL: http://svn.apache.org/viewvc?rev=1327712&view=rev Log: GERONIMO-6330: NPE in CompositeELResolver (and fix formatting a bit) Modified: geronimo/specs/trunk/geronimo-el_2.2_spec/src/main/java/javax/el/CompositeELResolver.java Modified: geronimo/specs/trunk/geronimo-el_2.2_spec/src/main/java/javax/el/CompositeELResolver.java URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-el_2.2_spec/src/main/java/javax/el/CompositeELResolver.java?rev=1327712&r1=1327711&r2=1327712&view=diff ============================================================================== --- geronimo/specs/trunk/geronimo-el_2.2_spec/src/main/java/javax/el/CompositeELResolver.java (original) +++ geronimo/specs/trunk/geronimo-el_2.2_spec/src/main/java/javax/el/CompositeELResolver.java Wed Apr 18 22:43:31 2012 @@ -47,12 +47,12 @@ public class CompositeELResolver extends public Object getValue(ELContext context, Object base, Object property) throws NullPointerException, PropertyNotFoundException, ELException { context.setPropertyResolved(false); - int sz; - ELResolver[] rslvrs; - synchronized (this) { - sz = this.size; - rslvrs = this.resolvers; - } + int sz; + ELResolver[] rslvrs; + synchronized (this) { + sz = this.size; + rslvrs = this.resolvers; + } Object result = null; for (int i = 0; i < sz; i++) { result = rslvrs[i].getValue(context, base, property); @@ -68,12 +68,12 @@ public class CompositeELResolver extends PropertyNotFoundException, PropertyNotWritableException, ELException { context.setPropertyResolved(false); - int sz; - ELResolver[] rslvrs; - synchronized (this) { - sz = this.size; - rslvrs = this.resolvers; - } + int sz; + ELResolver[] rslvrs; + synchronized (this) { + sz = this.size; + rslvrs = this.resolvers; + } for (int i = 0; i < sz; i++) { rslvrs[i].setValue(context, base, property, value); if (context.isPropertyResolved()) { @@ -85,12 +85,12 @@ public class CompositeELResolver extends public boolean isReadOnly(ELContext context, Object base, Object property) throws NullPointerException, PropertyNotFoundException, ELException { context.setPropertyResolved(false); - int sz; - ELResolver[] rslvrs; - synchronized (this) { - sz = this.size; - rslvrs = this.resolvers; - } + int sz; + ELResolver[] rslvrs; + synchronized (this) { + sz = this.size; + rslvrs = this.resolvers; + } boolean readOnly = false; for (int i = 0; i < sz; i++) { readOnly = rslvrs[i].isReadOnly(context, base, property); @@ -106,12 +106,12 @@ public class CompositeELResolver extends } public Class getCommonPropertyType(ELContext context, Object base) { - int sz; - ELResolver[] rslvrs; - synchronized (this) { - sz = this.size; - rslvrs = this.resolvers; - } + 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 = rslvrs[i].getCommonPropertyType(context, base); @@ -126,12 +126,12 @@ public class CompositeELResolver extends public Class getType(ELContext context, Object base, Object property) throws NullPointerException, PropertyNotFoundException, ELException { context.setPropertyResolved(false); - int sz; - ELResolver[] rslvrs; - synchronized (this) { - sz = this.size; - rslvrs = this.resolvers; - } + int sz; + ELResolver[] rslvrs; + synchronized (this) { + sz = this.size; + rslvrs = this.resolvers; + } Class type; for (int i = 0; i < sz; i++) { type = rslvrs[i].getType(context, base, property); @@ -220,9 +220,15 @@ public class CompositeELResolver extends if (context.getContext(ExpressionFactory.class) == null) { context.putContext(ExpressionFactory.class, expressionFactory); } + int sz; + ELResolver[] rslvrs; + synchronized (this) { + sz = this.size; + rslvrs = this.resolvers; + } Object retValue = null; - for (ELResolver resolver : resolvers) { - retValue = resolver.invoke(context, base, targetMethod, paramTypes, params); + for (int i = 0; i < sz; i++) { + retValue = rslvrs[i].invoke(context, base, targetMethod, paramTypes, params); if (context.isPropertyResolved()) { return retValue; }