[jboss-cvs] jboss-seam/src/main/org/jboss/seam/core ...
Gavin King
gavin.king at jboss.com
Wed Mar 7 18:53:58 EST 2007
User: gavin
Date: 07/03/07 18:53:58
Modified: src/main/org/jboss/seam/core Expressions.java
Validators.java
Log:
JBSEAM-913
Revision Changes Path
1.18 +5 -1 jboss-seam/src/main/org/jboss/seam/core/Expressions.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Expressions.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/core/Expressions.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- Expressions.java 23 Feb 2007 17:41:08 -0000 1.17
+++ Expressions.java 7 Mar 2007 23:53:57 -0000 1.18
@@ -1,4 +1,4 @@
-//$Id: Expressions.java,v 1.17 2007/02/23 17:41:08 nrichards Exp $
+//$Id: Expressions.java,v 1.18 2007/03/07 23:53:57 gavin Exp $
package org.jboss.seam.core;
import static org.jboss.seam.InterceptionType.NEVER;
@@ -194,6 +194,10 @@
*/
private static ClassValidator getValidator(Object instance, String componentName)
{
+ if (instance==null || componentName==null )
+ {
+ throw new IllegalArgumentException();
+ }
Component component = Component.forName(componentName);
return ( component==null ? Model.forClass( instance.getClass() ) : component ).getValidator();
}
1.3 +2 -2 jboss-seam/src/main/org/jboss/seam/core/Validators.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Validators.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/core/Validators.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- Validators.java 27 Jan 2007 01:55:25 -0000 1.2
+++ Validators.java 7 Mar 2007 23:53:57 -0000 1.3
@@ -114,8 +114,8 @@
componentName = propertyExpression.substring(2, bracket);
propertyName = propertyExpression.substring( bracket+1, propertyExpression.length()-2 );
}
-
String modelExpression = propertyExpression.substring(0, dot) + '}';
+
Object model = context.getApplication().createValueBinding(modelExpression).getValue(context);
ClassValidator validator = getValidator( model.getClass(), componentName );
return validator.getPotentialInvalidValues(propertyName, value);
More information about the jboss-cvs-commits
mailing list