dev@javaserverfaces.java.net

[REVIEW] Ensure the *ChainWrapers are in compliance with sections 5.6.1.5 and 5.6.1.6 of the spec

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Tue, 30 May 2006 07:50:27 -0700

Ensure the *ChainWrapers are in compliance with sections 5.6.1.5 and
5.6.1.6 of the spec.



SECTION: Modified Files
----------------------------
M jsf-ri/src/com/sun/faces/el/PropertyResolverChainWrapper.java
M jsf-ri/src/com/sun/faces/el/VariableResolverChainWrapper.java
  - ELContext.setPropertyResolved(true). Only set to
    false if an exception is thrown.


SECTION: Diffs
----------------------------
Index: jsf-ri/src/com/sun/faces/el/PropertyResolverChainWrapper.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/el/PropertyResolverChainWrapper.java,v
retrieving revision 1.9
diff -u -r1.9 PropertyResolverChainWrapper.java
--- jsf-ri/src/com/sun/faces/el/PropertyResolverChainWrapper.java 17
May 2006 17:31:29 -0000 1.9
+++ jsf-ri/src/com/sun/faces/el/PropertyResolverChainWrapper.java 30
May 2006 14:48:30 -0000
@@ -57,7 +57,7 @@
             return null;
         }
         Object result = null;
-
+ context.setPropertyResolved(true);
         FacesContext facesContext = (FacesContext)
             context.getContext(FacesContext.class);
         if (base instanceof List || base.getClass().isArray()) {
@@ -65,8 +65,7 @@
                     coerceToType(property, Integer.class);
             int index = ((Integer)indexObj).intValue();
             try {
- result = legacyPR.getValue(base, index);
- context.setPropertyResolved(result != null);
+ result = legacyPR.getValue(base, index);
             } catch (EvaluationException ex) {
                 context.setPropertyResolved(false);
                 throw new ELException(ex);
@@ -93,7 +92,7 @@
         }
         
         Class result = null;
-
+ context.setPropertyResolved(true);
         if (base instanceof List || base.getClass().isArray()) {
             FacesContext facesContext = (FacesContext)
                 context.getContext(FacesContext.class);
@@ -101,8 +100,7 @@
                     coerceToType(property, Integer.class);
             int index = ((Integer)indexObj).intValue();
             try {
- result = legacyPR.getType(base, index);
- context.setPropertyResolved(result != null);
+ result = legacyPR.getType(base, index);
             } catch (EvaluationException ex) {
                 context.setPropertyResolved(false);
                 throw new ELException(ex);
@@ -160,7 +158,7 @@
             return false;
         }
         boolean result = false;
-
+ context.setPropertyResolved(true);
         if (base instanceof List || base.getClass().isArray()) {
             FacesContext facesContext = (FacesContext)
             context.getContext(FacesContext.class);
Index: jsf-ri/src/com/sun/faces/el/VariableResolverChainWrapper.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/el/VariableResolverChainWrapper.java,v
retrieving revision 1.9
diff -u -r1.9 VariableResolverChainWrapper.java
--- jsf-ri/src/com/sun/faces/el/VariableResolverChainWrapper.java 17
May 2006 19:00:46 -0000 1.9
+++ jsf-ri/src/com/sun/faces/el/VariableResolverChainWrapper.java 30
May 2006 14:48:30 -0000
@@ -73,6 +73,7 @@
                 (MessageUtils.NULL_PARAMETERS_ERROR_MESSAGE_ID, "base
and property"); // ?????
             throw new PropertyNotFoundException(message);
         }
+ context.setPropertyResolved(true);
         Object result = null;
         
         FacesContext facesContext = (FacesContext)
@@ -90,9 +91,7 @@
             requestMap.put(REENTRANT_GUARD, REENTRANT_GUARD);
             
             result = legacyVR.resolveVariable(facesContext,
- (String)property);
-
- context.setPropertyResolved(result != null);
+
(String)property);
         } catch (EvaluationException ex) {
             context.setPropertyResolved(false);
             throw new ELException(ex);