You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by or...@apache.org on 2005/09/05 02:32:52 UTC
svn commit: r278654 - in /myfaces/impl/trunk/src/java/org/apache/myfaces:
context/ context/portlet/ context/servlet/ el/
Author: oros
Date: Sun Sep 4 17:32:35 2005
New Revision: 278654
URL: http://svn.apache.org/viewcvs?rev=278654&view=rev
Log:
fixed various JSR127 compliance issues
Modified:
myfaces/impl/trunk/src/java/org/apache/myfaces/context/FacesContextFactoryImpl.java
myfaces/impl/trunk/src/java/org/apache/myfaces/context/portlet/ApplicationMap.java
myfaces/impl/trunk/src/java/org/apache/myfaces/context/portlet/InitParameterMap.java
myfaces/impl/trunk/src/java/org/apache/myfaces/context/portlet/RequestHeaderMap.java
myfaces/impl/trunk/src/java/org/apache/myfaces/context/portlet/RequestMap.java
myfaces/impl/trunk/src/java/org/apache/myfaces/context/portlet/SessionMap.java
myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/ApplicationMap.java
myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/CookieMap.java
myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/InitParameterMap.java
myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/RequestHeaderMap.java
myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/RequestMap.java
myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/ServletFacesContextImpl.java
myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/SessionMap.java
myfaces/impl/trunk/src/java/org/apache/myfaces/el/MethodBindingImpl.java
myfaces/impl/trunk/src/java/org/apache/myfaces/el/PropertyResolverImpl.java
myfaces/impl/trunk/src/java/org/apache/myfaces/el/ValueBindingImpl.java
Modified: myfaces/impl/trunk/src/java/org/apache/myfaces/context/FacesContextFactoryImpl.java
URL: http://svn.apache.org/viewcvs/myfaces/impl/trunk/src/java/org/apache/myfaces/context/FacesContextFactoryImpl.java?rev=278654&r1=278653&r2=278654&view=diff
==============================================================================
--- myfaces/impl/trunk/src/java/org/apache/myfaces/context/FacesContextFactoryImpl.java (original)
+++ myfaces/impl/trunk/src/java/org/apache/myfaces/context/FacesContextFactoryImpl.java Sun Sep 4 17:32:35 2005
@@ -42,6 +42,19 @@
Lifecycle lifecycle)
throws FacesException
{
+ if (context == null) {
+ throw new NullPointerException("context");
+ }
+ if (request == null) {
+ throw new NullPointerException("request");
+ }
+ if (response == null) {
+ throw new NullPointerException("response");
+ }
+ if (lifecycle == null) {
+ throw new NullPointerException("lifecycle");
+ }
+
if (context instanceof ServletContext)
{
return new ServletFacesContextImpl((ServletContext)context,
Modified: myfaces/impl/trunk/src/java/org/apache/myfaces/context/portlet/ApplicationMap.java
URL: http://svn.apache.org/viewcvs/myfaces/impl/trunk/src/java/org/apache/myfaces/context/portlet/ApplicationMap.java?rev=278654&r1=278653&r2=278654&view=diff
==============================================================================
--- myfaces/impl/trunk/src/java/org/apache/myfaces/context/portlet/ApplicationMap.java (original)
+++ myfaces/impl/trunk/src/java/org/apache/myfaces/context/portlet/ApplicationMap.java Sun Sep 4 17:32:35 2005
@@ -16,6 +16,7 @@
package org.apache.myfaces.context.portlet;
import java.util.Enumeration;
+import java.util.Map;
import javax.portlet.PortletContext;
import org.apache.myfaces.context.servlet.AbstractAttributeMap;
@@ -55,4 +56,15 @@
{
return _portletContext.getAttributeNames();
}
+
+ public void putAll(Map t)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+
+ public void clear()
+ {
+ throw new UnsupportedOperationException();
+ }
}
Modified: myfaces/impl/trunk/src/java/org/apache/myfaces/context/portlet/InitParameterMap.java
URL: http://svn.apache.org/viewcvs/myfaces/impl/trunk/src/java/org/apache/myfaces/context/portlet/InitParameterMap.java?rev=278654&r1=278653&r2=278654&view=diff
==============================================================================
--- myfaces/impl/trunk/src/java/org/apache/myfaces/context/portlet/InitParameterMap.java (original)
+++ myfaces/impl/trunk/src/java/org/apache/myfaces/context/portlet/InitParameterMap.java Sun Sep 4 17:32:35 2005
@@ -18,6 +18,7 @@
package org.apache.myfaces.context.portlet;
import java.util.Enumeration;
+import java.util.Map;
import javax.portlet.PortletContext;
import org.apache.myfaces.context.servlet.AbstractAttributeMap;
@@ -73,5 +74,15 @@
retValue = super.hashCode();
return retValue;
}
+
+ public void putAll(Map t)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void clear()
+ {
+ throw new UnsupportedOperationException();
+ }
}
Modified: myfaces/impl/trunk/src/java/org/apache/myfaces/context/portlet/RequestHeaderMap.java
URL: http://svn.apache.org/viewcvs/myfaces/impl/trunk/src/java/org/apache/myfaces/context/portlet/RequestHeaderMap.java?rev=278654&r1=278653&r2=278654&view=diff
==============================================================================
--- myfaces/impl/trunk/src/java/org/apache/myfaces/context/portlet/RequestHeaderMap.java (original)
+++ myfaces/impl/trunk/src/java/org/apache/myfaces/context/portlet/RequestHeaderMap.java Sun Sep 4 17:32:35 2005
@@ -16,6 +16,7 @@
package org.apache.myfaces.context.portlet;
import java.util.Enumeration;
+import java.util.Map;
import javax.portlet.PortletRequest;
import org.apache.myfaces.context.servlet.AbstractAttributeMap;
@@ -57,4 +58,15 @@
{
return _portletRequest.getPropertyNames();
}
+
+ public void putAll(Map t)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+
+ public void clear()
+ {
+ throw new UnsupportedOperationException();
+ }
}
Modified: myfaces/impl/trunk/src/java/org/apache/myfaces/context/portlet/RequestMap.java
URL: http://svn.apache.org/viewcvs/myfaces/impl/trunk/src/java/org/apache/myfaces/context/portlet/RequestMap.java?rev=278654&r1=278653&r2=278654&view=diff
==============================================================================
--- myfaces/impl/trunk/src/java/org/apache/myfaces/context/portlet/RequestMap.java (original)
+++ myfaces/impl/trunk/src/java/org/apache/myfaces/context/portlet/RequestMap.java Sun Sep 4 17:32:35 2005
@@ -16,6 +16,7 @@
package org.apache.myfaces.context.portlet;
import java.util.Enumeration;
+import java.util.Map;
import javax.portlet.PortletRequest;
import org.apache.myfaces.context.servlet.AbstractAttributeMap;
@@ -54,4 +55,15 @@
{
return _portletRequest.getAttributeNames();
}
+
+ public void putAll(Map t)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+
+ public void clear()
+ {
+ throw new UnsupportedOperationException();
+ }
}
Modified: myfaces/impl/trunk/src/java/org/apache/myfaces/context/portlet/SessionMap.java
URL: http://svn.apache.org/viewcvs/myfaces/impl/trunk/src/java/org/apache/myfaces/context/portlet/SessionMap.java?rev=278654&r1=278653&r2=278654&view=diff
==============================================================================
--- myfaces/impl/trunk/src/java/org/apache/myfaces/context/portlet/SessionMap.java (original)
+++ myfaces/impl/trunk/src/java/org/apache/myfaces/context/portlet/SessionMap.java Sun Sep 4 17:32:35 2005
@@ -18,6 +18,7 @@
import org.apache.myfaces.util.NullEnumeration;
import java.util.Enumeration;
+import java.util.Map;
import javax.portlet.PortletRequest;
import javax.portlet.PortletSession;
import org.apache.myfaces.context.servlet.AbstractAttributeMap;
@@ -70,4 +71,15 @@
{
return _portletRequest.getPortletSession(false);
}
+
+ public void putAll(Map t)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+
+ public void clear()
+ {
+ throw new UnsupportedOperationException();
+ }
}
Modified: myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/ApplicationMap.java
URL: http://svn.apache.org/viewcvs/myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/ApplicationMap.java?rev=278654&r1=278653&r2=278654&view=diff
==============================================================================
--- myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/ApplicationMap.java (original)
+++ myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/ApplicationMap.java Sun Sep 4 17:32:35 2005
@@ -16,6 +16,7 @@
package org.apache.myfaces.context.servlet;
import java.util.Enumeration;
+import java.util.Map;
import javax.servlet.ServletContext;
@@ -53,5 +54,17 @@
protected Enumeration getAttributeNames()
{
return _servletContext.getAttributeNames();
+ }
+
+
+ public void putAll(Map t)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+
+ public void clear()
+ {
+ throw new UnsupportedOperationException();
}
}
Modified: myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/CookieMap.java
URL: http://svn.apache.org/viewcvs/myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/CookieMap.java?rev=278654&r1=278653&r2=278654&view=diff
==============================================================================
--- myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/CookieMap.java (original)
+++ myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/CookieMap.java Sun Sep 4 17:32:35 2005
@@ -16,6 +16,7 @@
package org.apache.myfaces.context.servlet;
import java.util.Enumeration;
+import java.util.Map;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
@@ -70,7 +71,7 @@
if (cookies == null) return false;
for (int i = 0, len = cookies.length; i < len; i++)
{
- if (findValue.equals(cookies[i].getValue()))
+ if (findValue.equals(cookies[i]))
{
return true;
}
@@ -90,6 +91,12 @@
Cookie[] cookies = _httpServletRequest.getCookies();
return cookies == null ? 0 : cookies.length;
}
+
+ public void putAll(Map t)
+ {
+ throw new UnsupportedOperationException();
+ }
+
protected Object getAttribute(String key)
{
Modified: myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/InitParameterMap.java
URL: http://svn.apache.org/viewcvs/myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/InitParameterMap.java?rev=278654&r1=278653&r2=278654&view=diff
==============================================================================
--- myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/InitParameterMap.java (original)
+++ myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/InitParameterMap.java Sun Sep 4 17:32:35 2005
@@ -16,6 +16,7 @@
package org.apache.myfaces.context.servlet;
import java.util.Enumeration;
+import java.util.Map;
import javax.servlet.ServletContext;
@@ -55,5 +56,16 @@
protected Enumeration getAttributeNames()
{
return _servletContext.getInitParameterNames();
+ }
+
+ public void putAll(Map t)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+
+ public void clear()
+ {
+ throw new UnsupportedOperationException();
}
}
Modified: myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/RequestHeaderMap.java
URL: http://svn.apache.org/viewcvs/myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/RequestHeaderMap.java?rev=278654&r1=278653&r2=278654&view=diff
==============================================================================
--- myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/RequestHeaderMap.java (original)
+++ myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/RequestHeaderMap.java Sun Sep 4 17:32:35 2005
@@ -16,6 +16,7 @@
package org.apache.myfaces.context.servlet;
import java.util.Enumeration;
+import java.util.Map;
import javax.servlet.http.HttpServletRequest;
@@ -56,4 +57,15 @@
{
return _httpServletRequest.getHeaderNames();
}
+
+ public void putAll(Map t)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+
+ public void clear()
+ {
+ throw new UnsupportedOperationException();
+ }
}
Modified: myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/RequestMap.java
URL: http://svn.apache.org/viewcvs/myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/RequestMap.java?rev=278654&r1=278653&r2=278654&view=diff
==============================================================================
--- myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/RequestMap.java (original)
+++ myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/RequestMap.java Sun Sep 4 17:32:35 2005
@@ -16,6 +16,7 @@
package org.apache.myfaces.context.servlet;
import java.util.Enumeration;
+import java.util.Map;
import javax.servlet.ServletRequest;
@@ -54,4 +55,15 @@
{
return _servletRequest.getAttributeNames();
}
+
+ public void putAll(Map t)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+
+ public void clear()
+ {
+ throw new UnsupportedOperationException();
+ }
}
Modified: myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/ServletFacesContextImpl.java
URL: http://svn.apache.org/viewcvs/myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/ServletFacesContextImpl.java?rev=278654&r1=278653&r2=278654&view=diff
==============================================================================
--- myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/ServletFacesContextImpl.java (original)
+++ myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/ServletFacesContextImpl.java Sun Sep 4 17:32:35 2005
@@ -55,11 +55,12 @@
private ReleaseableExternalContext _externalContext;
private ResponseStream _responseStream = null;
private ResponseWriter _responseWriter = null;
- private FacesMessage.Severity _maximumSeverity = FacesMessage.SEVERITY_INFO;
+ private FacesMessage.Severity _maximumSeverity = null;
private UIViewRoot _viewRoot;
private boolean _renderResponse = false;
private boolean _responseComplete = false;
private RenderKitFactory _renderKitFactory;
+ private boolean _released = false;
//~ Constructors -------------------------------------------------------------------------------
@@ -95,26 +96,42 @@
public ExternalContext getExternalContext()
{
+ if (_released) {
+ throw new IllegalStateException("FacesContext already released");
+ }
return (ExternalContext)_externalContext;
}
public FacesMessage.Severity getMaximumSeverity()
{
+ if (_released) {
+ throw new IllegalStateException("FacesContext already released");
+ }
return _maximumSeverity;
}
public Iterator getMessages()
{
+ if (_released) {
+ throw new IllegalStateException("FacesContext already released");
+ }
return (_messages != null) ? _messages.iterator() : Collections.EMPTY_LIST.iterator();
}
public Application getApplication()
{
+ if (_released) {
+ throw new IllegalStateException("FacesContext already released");
+ }
+
return _application;
}
public Iterator getClientIdsWithMessages()
{
+ if (_released) {
+ throw new IllegalStateException("FacesContext already released");
+ }
if (_messages == null || _messages.isEmpty())
{
return NullIterator.instance();
@@ -126,6 +143,9 @@
public Iterator getMessages(String clientId)
{
+ if (_released) {
+ throw new IllegalStateException("FacesContext already released");
+ }
if (_messages == null)
{
return NullIterator.instance();
@@ -166,16 +186,25 @@
public boolean getRenderResponse()
{
+ if (_released) {
+ throw new IllegalStateException("FacesContext already released");
+ }
return _renderResponse;
}
public boolean getResponseComplete()
{
+ if (_released) {
+ throw new IllegalStateException("FacesContext already released");
+ }
return _responseComplete;
}
public void setResponseStream(ResponseStream responseStream)
{
+ if (_released) {
+ throw new IllegalStateException("FacesContext already released");
+ }
if (responseStream == null)
{
throw new NullPointerException("responseStream");
@@ -185,11 +214,17 @@
public ResponseStream getResponseStream()
{
+ if (_released) {
+ throw new IllegalStateException("FacesContext already released");
+ }
return _responseStream;
}
public void setResponseWriter(ResponseWriter responseWriter)
{
+ if (_released) {
+ throw new IllegalStateException("FacesContext already released");
+ }
if (responseWriter == null)
{
throw new NullPointerException("responseWriter");
@@ -199,11 +234,17 @@
public ResponseWriter getResponseWriter()
{
+ if (_released) {
+ throw new IllegalStateException("FacesContext already released");
+ }
return _responseWriter;
}
public void setViewRoot(UIViewRoot viewRoot)
{
+ if (_released) {
+ throw new IllegalStateException("FacesContext already released");
+ }
if (viewRoot == null)
{
throw new NullPointerException("viewRoot");
@@ -213,11 +254,17 @@
public UIViewRoot getViewRoot()
{
+ if (_released) {
+ throw new IllegalStateException("FacesContext already released");
+ }
return _viewRoot;
}
public void addMessage(String clientId, FacesMessage message)
{
+ if (_released) {
+ throw new IllegalStateException("FacesContext already released");
+ }
if (message == null)
{
throw new NullPointerException("message");
@@ -231,14 +278,23 @@
_messages.add(message);
_messageClientIds.add((clientId != null) ? clientId : null);
FacesMessage.Severity serSeverity = message.getSeverity();
- if (serSeverity != null && serSeverity.compareTo(_maximumSeverity) > 0)
- {
- _maximumSeverity = message.getSeverity();
+ if (serSeverity != null) {
+ if (_maximumSeverity == null)
+ {
+ _maximumSeverity = serSeverity;
+ }
+ else if (serSeverity.compareTo(_maximumSeverity) > 0)
+ {
+ _maximumSeverity = serSeverity;
+ }
}
}
public void release()
{
+ if (_released) {
+ throw new IllegalStateException("FacesContext already released");
+ }
if (_externalContext != null)
{
_externalContext.release();
@@ -252,16 +308,23 @@
_responseWriter = null;
_viewRoot = null;
+ _released = true;
FacesContext.setCurrentInstance(null);
}
public void renderResponse()
{
+ if (_released) {
+ throw new IllegalStateException("FacesContext already released");
+ }
_renderResponse = true;
}
public void responseComplete()
{
+ if (_released) {
+ throw new IllegalStateException("FacesContext already released");
+ }
_responseComplete = true;
}
Modified: myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/SessionMap.java
URL: http://svn.apache.org/viewcvs/myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/SessionMap.java?rev=278654&r1=278653&r2=278654&view=diff
==============================================================================
--- myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/SessionMap.java (original)
+++ myfaces/impl/trunk/src/java/org/apache/myfaces/context/servlet/SessionMap.java Sun Sep 4 17:32:35 2005
@@ -20,6 +20,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.Enumeration;
+import java.util.Map;
+
/**
* HttpSession attibutes as Map.
@@ -68,5 +70,17 @@
private HttpSession getSession()
{
return _httpRequest.getSession(false);
+ }
+
+
+ public void putAll(Map t)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+
+ public void clear()
+ {
+ throw new UnsupportedOperationException();
}
}
Modified: myfaces/impl/trunk/src/java/org/apache/myfaces/el/MethodBindingImpl.java
URL: http://svn.apache.org/viewcvs/myfaces/impl/trunk/src/java/org/apache/myfaces/el/MethodBindingImpl.java?rev=278654&r1=278653&r2=278654&view=diff
==============================================================================
--- myfaces/impl/trunk/src/java/org/apache/myfaces/el/MethodBindingImpl.java (original)
+++ myfaces/impl/trunk/src/java/org/apache/myfaces/el/MethodBindingImpl.java Sun Sep 4 17:32:35 2005
@@ -68,14 +68,23 @@
public Class getType(FacesContext facesContext)
{
+ if (facesContext == null) {
+ throw new NullPointerException("facesContext");
+ }
try
{
Object[] baseAndProperty = resolveToBaseAndProperty(facesContext);
Object base = baseAndProperty[0];
Object property = baseAndProperty[1];
- return base.getClass().getMethod(property.toString(), _argClasses)
- .getReturnType();
+ Class returnType = base.getClass().getMethod(property.toString(), _argClasses).getReturnType();
+
+ if (returnType.getName().equals("void")) {
+ // the spec document says: "if type is void return null"
+ // but the RI returns Void.class, so let's follow the RI
+ return Void.class;
+ }
+ return returnType;
}
catch (ReferenceSyntaxException e)
{
@@ -97,6 +106,9 @@
public Object invoke(FacesContext facesContext, Object[] args)
throws EvaluationException, MethodNotFoundException
{
+ if (facesContext == null) {
+ throw new NullPointerException("facesContext");
+ }
try
{
Object[] baseAndProperty = resolveToBaseAndProperty(facesContext);
Modified: myfaces/impl/trunk/src/java/org/apache/myfaces/el/PropertyResolverImpl.java
URL: http://svn.apache.org/viewcvs/myfaces/impl/trunk/src/java/org/apache/myfaces/el/PropertyResolverImpl.java?rev=278654&r1=278653&r2=278654&view=diff
==============================================================================
--- myfaces/impl/trunk/src/java/org/apache/myfaces/el/PropertyResolverImpl.java (original)
+++ myfaces/impl/trunk/src/java/org/apache/myfaces/el/PropertyResolverImpl.java Sun Sep 4 17:32:35 2005
@@ -70,6 +70,9 @@
// If none of the special bean types, then process as normal Bean
return getProperty(base, property.toString());
}
+ catch (PropertyNotFoundException e) {
+ throw e;
+ }
catch (RuntimeException e)
{
throw new EvaluationException("Exception getting value of property " + property
@@ -144,6 +147,9 @@
// If none of the special bean types, then process as normal Bean
setProperty(base, property.toString(), newValue);
}
+ catch (PropertyNotFoundException e) {
+ throw e;
+ }
catch (RuntimeException e)
{
throw new EvaluationException("Exception setting property " + property
@@ -191,6 +197,9 @@
"Bean must be array or List. Bean: "
+ base.getClass().getName() + ", index " + index);
}
+ catch (PropertyNotFoundException e) {
+ throw e;
+ }
catch (RuntimeException e)
{
throw new EvaluationException("Exception setting value of index " + index + " of bean "
@@ -260,8 +269,7 @@
if (base == null || property == null ||
property instanceof String && ((String)property).length() == 0)
{
- // Cannot determine type, return null per JSF spec
- return null;
+ throw new PropertyNotFoundException("Bean is null");
}
if (base instanceof Map)
@@ -278,6 +286,9 @@
return propertyDescriptor.getPropertyType();
}
+ catch (PropertyNotFoundException e) {
+ throw e;
+ }
catch (Exception e)
{
// Cannot determine type, return null per JSF spec
@@ -291,13 +302,13 @@
{
if (base == null)
{
- // Cannot determine type, return null per JSF spec
- return null;
+ throw new PropertyNotFoundException("Bean is null");
}
if (base.getClass().isArray())
{
- return base.getClass().getComponentType();
+ Object[] array = (Object[]) base;
+ return array[index].getClass().getComponentType();
}
if (base instanceof List)
@@ -313,6 +324,10 @@
// Cannot determine type, return null per JSF spec
return null;
+ }
+ catch (IndexOutOfBoundsException e) {
+ throw new PropertyNotFoundException("Bean: "
+ + base.getClass().getName() + ", index " + index, e);
}
catch (Exception e)
{
Modified: myfaces/impl/trunk/src/java/org/apache/myfaces/el/ValueBindingImpl.java
URL: http://svn.apache.org/viewcvs/myfaces/impl/trunk/src/java/org/apache/myfaces/el/ValueBindingImpl.java?rev=278654&r1=278653&r2=278654&view=diff
==============================================================================
--- myfaces/impl/trunk/src/java/org/apache/myfaces/el/ValueBindingImpl.java (original)
+++ myfaces/impl/trunk/src/java/org/apache/myfaces/el/ValueBindingImpl.java Sun Sep 4 17:32:35 2005
@@ -124,6 +124,9 @@
public boolean isReadOnly(FacesContext facesContext)
{
+ if (facesContext == null) {
+ throw new NullPointerException("facesContext");
+ }
try
{
Object base_ = resolveToBaseAndProperty(facesContext);
@@ -158,6 +161,9 @@
public Class getType(FacesContext facesContext)
{
+ if (facesContext == null) {
+ throw new NullPointerException("facesContext");
+ }
try
{
Object base_ = resolveToBaseAndProperty(facesContext);
@@ -215,6 +221,9 @@
return null;
}
}
+ catch (PropertyNotFoundException e) {
+ throw e;
+ }
catch (Exception e)
{
// Cannot determine type, return null per JSF spec
@@ -225,6 +234,9 @@
public void setValue(FacesContext facesContext, Object newValue)
throws EvaluationException, PropertyNotFoundException
{
+ if (facesContext == null) {
+ throw new NullPointerException("facesContext");
+ }
try
{
Object base_ = resolveToBaseAndProperty(facesContext);
@@ -356,6 +368,9 @@
public Object getValue(FacesContext facesContext)
throws EvaluationException, PropertyNotFoundException
{
+ if (facesContext == null) {
+ throw new NullPointerException("facesContext");
+ }
try
{
return _expression instanceof Expression
@@ -365,6 +380,9 @@
: ((ExpressionString) _expression).evaluate(
new ELVariableResolver(facesContext),
s_functionMapper, ELParserHelper.LOGGER);
+ }
+ catch (PropertyNotFoundException e) {
+ throw e;
}
catch (IndexOutOfBoundsException e)
{