You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2012/10/19 18:19:42 UTC
svn commit: r1400150 -
/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/ResourceBundleResolver.java
Author: lu4242
Date: Fri Oct 19 16:19:41 2012
New Revision: 1400150
URL: http://svn.apache.org/viewvc?rev=1400150&view=rev
Log:
MYFACES-3632 resource bundle name with bean property collition when trying to set value
Modified:
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/ResourceBundleResolver.java
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/ResourceBundleResolver.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/ResourceBundleResolver.java?rev=1400150&r1=1400149&r2=1400150&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/ResourceBundleResolver.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/ResourceBundleResolver.java Fri Oct 19 16:19:41 2012
@@ -55,6 +55,17 @@ public final class ResourceBundleResolve
public void setValue(final ELContext context, final Object base, final Object property, final Object value)
throws NullPointerException, PropertyNotFoundException, PropertyNotWritableException, ELException
{
+ // JSF 2.0 spec section 5.6.1.4
+ // "... If base is null and property is a String equal to the value of the
+ // <var> element of one of the <resource-bundle>'s in the application
+ // configuration resources throw javax.el.PropertyNotWriteable, since
+ // ResourceBundles are read-only. ..."
+ // Since something is done only when base is null, it is better to check
+ // for not null and return.
+ if (base != null)
+ {
+ return;
+ }
if ((base == null) && (property == null))
{
@@ -66,6 +77,7 @@ public final class ResourceBundleResolve
return;
}
+ // base is null and property is a String value, check for resource bundle.
final ResourceBundle bundle = getResourceBundle(context, (String)property);
if (bundle != null)