cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject svn commit: r382120 - in /cocoon: branches/BRANCH_2_1_X/status.xml trunk/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/util/I18nMessage.java
Date Wed, 01 Mar 2006 18:49:14 GMT
Author: antonio
Date: Wed Mar  1 10:49:13 2006
New Revision: 382120

URL: http://svn.apache.org/viewcvs?rev=382120&view=rev
Log:
<action dev="AG" type="fix" fixes-bug="COCOON-1785" due-to="Eric Meyer" due-to-email="eric.meyer@quoininc.com">
       Form block: I18nMessage - null parameter values causes NPE.
    </action>

Modified:
    cocoon/branches/BRANCH_2_1_X/status.xml
    cocoon/trunk/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/util/I18nMessage.java

Modified: cocoon/branches/BRANCH_2_1_X/status.xml
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/status.xml?rev=382120&r1=382119&r2=382120&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/status.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/status.xml Wed Mar  1 10:49:13 2006
@@ -180,8 +180,11 @@
   <release version="@version@" date="@date@">
 -->
   <release version="2.1.9" date="TBD">
+    <action dev="AG" type="fix" fixes-bug="COCOON-1785" due-to="Eric Meyer" due-to-email="eric.meyer@quoininc.com">
+       Form block: I18nMessage - null parameter values causes NPE.
+    </action>
     <action dev="AG" type="fix" fixes-bug="COCOON-1786" due-to="Eric Meyer" due-to-email="eric.meyer@quoininc.com">
-       Ajax block: BrowserUpdateTransformer can get into invalid state - must override recycle()
+       Ajax block: BrowserUpdateTransformer can get into invalid state - must override recycle().
     </action>
     <action dev="JBQ" type="fix" fixes-bug="COCOON-1279">
       Fix caching-point pipelines.  Remove the undocumented smart-caching parameter.

Modified: cocoon/trunk/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/util/I18nMessage.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/util/I18nMessage.java?rev=382120&r1=382119&r2=382120&view=diff
==============================================================================
--- cocoon/trunk/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/util/I18nMessage.java
(original)
+++ cocoon/trunk/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/util/I18nMessage.java
Wed Mar  1 10:49:13 2006
@@ -123,18 +123,21 @@
         if (parameters != null) {
             for (int i = 0; i < parameters.length; i++) {
                 contentHandler.startElement(I18nTransformer.I18N_NAMESPACE_URI, I18nTransformer.I18N_PARAM_ELEMENT,
"i18n:" + I18nTransformer.I18N_PARAM_ELEMENT, XMLUtils.EMPTY_ATTRIBUTES);
-                if (keys != null && keys[i])
+                if (keys != null && keys[i]) {
                     contentHandler.startElement(I18nTransformer.I18N_NAMESPACE_URI, I18nTransformer.I18N_TEXT_ELEMENT,
"i18n:" + I18nTransformer.I18N_TEXT_ELEMENT, i18nAttrs);
-                contentHandler.characters(parameters[i].toCharArray(), 0, parameters[i].length());
-                if (keys != null && keys[i])
+                }
+                final String aParam = String.valueOf(parameters[i]);
+                contentHandler.characters(aParam.toCharArray(), 0, aParam.length());
+                if (keys != null && keys[i]) {
                     contentHandler.endElement(I18nTransformer.I18N_NAMESPACE_URI, I18nTransformer.I18N_TEXT_ELEMENT,
"i18n:" + I18nTransformer.I18N_TEXT_ELEMENT);
+                }
                 contentHandler.endElement(I18nTransformer.I18N_NAMESPACE_URI, I18nTransformer.I18N_PARAM_ELEMENT,
"i18n:" + I18nTransformer.I18N_PARAM_ELEMENT);
             }
             contentHandler.endElement(I18nTransformer.I18N_NAMESPACE_URI, I18nTransformer.I18N_TRANSLATE_ELEMENT,
"i18n:" + I18nTransformer.I18N_TRANSLATE_ELEMENT);
         }
         contentHandler.endPrefixMapping("i18n");
     }
-    
+
     public boolean equals(Object obj) {
         if (obj instanceof I18nMessage) {
             I18nMessage other = (I18nMessage)obj;



Mime
View raw message