incubator-bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1144025 - in /incubator/bval/sandbox/lang3-work/bval-jsr303-dynamic: extval-shared/src/main/java/org/apache/bval/jsr303/dynamic/extval/ extval12/src/main/java/org/apache/bval/jsr303/dynamic/extval/ extval20/src/main/java/org/apache/bval/js...
Date Thu, 07 Jul 2011 20:35:58 GMT
Author: mbenson
Date: Thu Jul  7 20:35:58 2011
New Revision: 1144025

URL: http://svn.apache.org/viewvc?rev=1144025&view=rev
Log:
only send ELContext to DynamicBeanValidationELHelper implementations instead of full FacesContext;
also fix a bug leading to infinite recursion :o

Modified:
    incubator/bval/sandbox/lang3-work/bval-jsr303-dynamic/extval-shared/src/main/java/org/apache/bval/jsr303/dynamic/extval/DynamicBeanValidationELHelper.java
    incubator/bval/sandbox/lang3-work/bval-jsr303-dynamic/extval12/src/main/java/org/apache/bval/jsr303/dynamic/extval/DynamicBeanValidationELHelper12.java
    incubator/bval/sandbox/lang3-work/bval-jsr303-dynamic/extval20/src/main/java/org/apache/bval/jsr303/dynamic/extval/DynamicBeanValidationELHelper20.java

Modified: incubator/bval/sandbox/lang3-work/bval-jsr303-dynamic/extval-shared/src/main/java/org/apache/bval/jsr303/dynamic/extval/DynamicBeanValidationELHelper.java
URL: http://svn.apache.org/viewvc/incubator/bval/sandbox/lang3-work/bval-jsr303-dynamic/extval-shared/src/main/java/org/apache/bval/jsr303/dynamic/extval/DynamicBeanValidationELHelper.java?rev=1144025&r1=1144024&r2=1144025&view=diff
==============================================================================
--- incubator/bval/sandbox/lang3-work/bval-jsr303-dynamic/extval-shared/src/main/java/org/apache/bval/jsr303/dynamic/extval/DynamicBeanValidationELHelper.java
(original)
+++ incubator/bval/sandbox/lang3-work/bval-jsr303-dynamic/extval-shared/src/main/java/org/apache/bval/jsr303/dynamic/extval/DynamicBeanValidationELHelper.java
Thu Jul  7 20:35:58 2011
@@ -19,6 +19,7 @@ package org.apache.bval.jsr303.dynamic.e
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.el.ELContext;
 import javax.el.ValueExpression;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
@@ -119,7 +120,7 @@ public abstract class DynamicBeanValidat
             }
             PathRecordingELResolver elResolver =
                 new PathRecordingELResolver(facesContext.getELContext().getELResolver(),
projectStageDevelopment);
-            resolve(valueExpression, elResolver, facesContext);
+            resolve(valueExpression, elResolver, facesContext.getELContext());
             PathBasedPropertyDetails result =
                 new PathBasedPropertyDetails(elResolver.getPath(), elResolver.getBaseObject(),
                     elResolver.getProperty(), elResolver.getBeanValidationPath());
@@ -134,8 +135,8 @@ public abstract class DynamicBeanValidat
      * 
      * @param valueExpression
      * @param elResolver
-     * @param facesContext
+     * @param elContext
      */
     protected abstract void resolve(ValueExpression valueExpression, PathRecordingELResolver
elResolver,
-        FacesContext facesContext);
+        ELContext elContext);
 }

Modified: incubator/bval/sandbox/lang3-work/bval-jsr303-dynamic/extval12/src/main/java/org/apache/bval/jsr303/dynamic/extval/DynamicBeanValidationELHelper12.java
URL: http://svn.apache.org/viewvc/incubator/bval/sandbox/lang3-work/bval-jsr303-dynamic/extval12/src/main/java/org/apache/bval/jsr303/dynamic/extval/DynamicBeanValidationELHelper12.java?rev=1144025&r1=1144024&r2=1144025&view=diff
==============================================================================
--- incubator/bval/sandbox/lang3-work/bval-jsr303-dynamic/extval12/src/main/java/org/apache/bval/jsr303/dynamic/extval/DynamicBeanValidationELHelper12.java
(original)
+++ incubator/bval/sandbox/lang3-work/bval-jsr303-dynamic/extval12/src/main/java/org/apache/bval/jsr303/dynamic/extval/DynamicBeanValidationELHelper12.java
Thu Jul  7 20:35:58 2011
@@ -18,7 +18,6 @@ package org.apache.bval.jsr303.dynamic.e
 
 import javax.el.ELContext;
 import javax.el.ValueExpression;
-import javax.faces.context.FacesContext;
 
 import org.apache.myfaces.extensions.validator.core.el.ExtValELResolver;
 
@@ -54,10 +53,8 @@ public class DynamicBeanValidationELHelp
      * {@inheritDoc}
      */
     @Override
-    protected void resolve(ValueExpression valueExpression, PathRecordingELResolver elResolver,
-        FacesContext facesContext) {
-        ELContext contextWrapper = ExtValELResolver.createContextWrapper(facesContext.getELContext(),
elResolver);
+    protected void resolve(ValueExpression valueExpression, PathRecordingELResolver elResolver,
ELContext elContext) {
+        ELContext contextWrapper = ExtValELResolver.createContextWrapper(elContext, elResolver);
         valueExpression.setValue(contextWrapper, null);
     }
-
 }

Modified: incubator/bval/sandbox/lang3-work/bval-jsr303-dynamic/extval20/src/main/java/org/apache/bval/jsr303/dynamic/extval/DynamicBeanValidationELHelper20.java
URL: http://svn.apache.org/viewvc/incubator/bval/sandbox/lang3-work/bval-jsr303-dynamic/extval20/src/main/java/org/apache/bval/jsr303/dynamic/extval/DynamicBeanValidationELHelper20.java?rev=1144025&r1=1144024&r2=1144025&view=diff
==============================================================================
--- incubator/bval/sandbox/lang3-work/bval-jsr303-dynamic/extval20/src/main/java/org/apache/bval/jsr303/dynamic/extval/DynamicBeanValidationELHelper20.java
(original)
+++ incubator/bval/sandbox/lang3-work/bval-jsr303-dynamic/extval20/src/main/java/org/apache/bval/jsr303/dynamic/extval/DynamicBeanValidationELHelper20.java
Thu Jul  7 20:35:58 2011
@@ -49,13 +49,11 @@ public class DynamicBeanValidationELHelp
      * {@inheritDoc}
      */
     @Override
-    protected void resolve(ValueExpression valueExpression, PathRecordingELResolver elResolver,
-        FacesContext facesContext) {
-        ELContext contextWrapper = ExtValELResolver.createContextWrapper(facesContext.getELContext(),
elResolver);
-        @SuppressWarnings("unused")
+    protected void resolve(ValueExpression valueExpression, PathRecordingELResolver elResolver,
ELContext elContext) {
+        ELContext contextWrapper = ExtValELResolver.createContextWrapper(elContext, elResolver);
         ValueExpression expr = valueExpression;
         while (true) {
-            valueExpression.setValue(contextWrapper, null);
+            expr.setValue(contextWrapper, null);
             Object baseObject = elResolver.getBaseObject();
             if (baseObject instanceof CompositeComponentExpressionHolder) {
                 expr = ((CompositeComponentExpressionHolder) baseObject).getExpression(elResolver.getProperty());



Mime
View raw message