You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by se...@apache.org on 2006/06/26 04:09:02 UTC
svn commit: r417109 - in /jakarta/turbine/fulcrum/trunk/intake:
src/java/org/apache/fulcrum/intake/model/Field.java xdocs/changes.xml
Author: seade
Date: Sun Jun 25 19:09:01 2006
New Revision: 417109
URL: http://svn.apache.org/viewvc?rev=417109&view=rev
Log:
TRB-9: Intake was not handling empty values correctly.
Also, Intake now handles the case where the mapToObject does not map to all fields in the group.
Thanks to Jürgen Hoffmann for the patch.
Modified:
jakarta/turbine/fulcrum/trunk/intake/src/java/org/apache/fulcrum/intake/model/Field.java
jakarta/turbine/fulcrum/trunk/intake/xdocs/changes.xml
Modified: jakarta/turbine/fulcrum/trunk/intake/src/java/org/apache/fulcrum/intake/model/Field.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/intake/src/java/org/apache/fulcrum/intake/model/Field.java?rev=417109&r1=417108&r2=417109&view=diff
==============================================================================
--- jakarta/turbine/fulcrum/trunk/intake/src/java/org/apache/fulcrum/intake/model/Field.java (original)
+++ jakarta/turbine/fulcrum/trunk/intake/src/java/org/apache/fulcrum/intake/model/Field.java Sun Jun 25 19:09:01 2006
@@ -333,7 +333,7 @@
{
log.debug(name + ": Found our Key in the request, setting Value");
}
- if (StringUtils.isNotEmpty(pp.getString(getKey())))
+ if (pp.getString(getKey()) != null)
{
setFlag = true;
}
@@ -863,7 +863,25 @@
try
{
- setter.invoke(obj, valArray);
+ /*
+ * In the case we map a Group to an Object using mapToObject, and we
+ * want to add an additional Field which should not be mapped, and
+ * we leave the mapToProperty empty, we will get a NPE here. So we
+ * have to double check, if we really have a setter set.
+ */
+ if(setter != null)
+ {
+ setter.invoke(obj, valArray);
+ }
+ else if (isDebugEnabled)
+ {
+ log.debug(name + ": has a null setter for the mapToProperty"
+ + " Attribute, although all Fields should be mapped"
+ + " to " + mapToObject + ". If this is unwanted, You"
+ + " should doublecheck the mapToProperty Attribute, and"
+ + " consult the logs. The Turbine Intake Serice will"
+ + " have logged a detailed Message with the error.");
+ }
}
catch (IllegalAccessException e)
{
Modified: jakarta/turbine/fulcrum/trunk/intake/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/intake/xdocs/changes.xml?rev=417109&r1=417108&r2=417109&view=diff
==============================================================================
--- jakarta/turbine/fulcrum/trunk/intake/xdocs/changes.xml (original)
+++ jakarta/turbine/fulcrum/trunk/intake/xdocs/changes.xml Sun Jun 25 19:09:01 2006
@@ -8,6 +8,13 @@
<body>
<release version="1.0.3" date="in Subversion">
+ <action type="update" dev="seade" issue="TRB-9" due-to="Jürgen Hoffmann">
+ Intake now handles the case where the mapToObject does not map to all
+ fields in the group.
+ </action>
+ <action type="fix" dev="seade" issue="TRB-9" due-to="Jürgen Hoffmann">
+ Intake was not handling empty values correctly.
+ </action>
<action type="fix" dev="eade" issue="TRB-14" due-to="Jürgen Hoffmann">
Intake was not loading the correct Default Validators when the rules for
a field are empty.
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org