myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1296043 - /myfaces/core/trunk/api/src/main/java/javax/faces/component/UIInput.java
Date Fri, 02 Mar 2012 03:34:57 GMT
Author: lu4242
Date: Fri Mar  2 03:34:57 2012
New Revision: 1296043

URL: http://svn.apache.org/viewvc?rev=1296043&view=rev
Log:
MYFACES-3434 UIInput.resetValue() throws NPE when no FacesContext available (Thanks to Martin
Koci for provide this patch)

Modified:
    myfaces/core/trunk/api/src/main/java/javax/faces/component/UIInput.java

Modified: myfaces/core/trunk/api/src/main/java/javax/faces/component/UIInput.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/component/UIInput.java?rev=1296043&r1=1296042&r2=1296043&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/component/UIInput.java (original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/component/UIInput.java Fri Mar  2 03:34:57
2012
@@ -123,10 +123,11 @@ public class UIInput extends UIOutput im
     @Override
     public void setValue(Object value)
     {
-        if (getFacesContext().isProjectStage(ProjectStage.Development))
+        FacesContext facesContext = getFacesContext();
+        if (facesContext != null && facesContext.isProjectStage(ProjectStage.Development))
         {
             // extended debug-info when in Development mode
-            _createFieldDebugInfo(getFacesContext(), "localValue",
+            _createFieldDebugInfo(facesContext, "localValue",
                     getLocalValue(), value, 1);
         }
         setLocalValueSet(true);
@@ -921,10 +922,11 @@ public class UIInput extends UIOutput im
 
     public void setSubmittedValue(Object submittedValue)
     {
-        if (getFacesContext().isProjectStage(ProjectStage.Development))
+        FacesContext facesContext = getFacesContext();
+        if (facesContext != null && facesContext.isProjectStage(ProjectStage.Development))
         {
             // extended debug-info when in Development mode
-            _createFieldDebugInfo(getFacesContext(), "submittedValue",
+            _createFieldDebugInfo(facesContext, "submittedValue",
                     getSubmittedValue(), submittedValue, 1);
         }
         getStateHelper().put(PropertyKeys.submittedValue, submittedValue );



Mime
View raw message