cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kpiroum...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/transformation I18nTransformer.java
Date Thu, 30 May 2002 11:55:23 GMT
kpiroumian    02/05/30 04:55:23

  Modified:    src/java/org/apache/cocoon/transformation Tag:
                        cocoon_2_0_3_branch I18nTransformer.java
  Log:
  Fixed NPE in number formatting
  PR:7726
  Submitted by: Michael Enke (michael.enke@wincor-nixdorf.com)
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.13.2.3  +4 -2      xml-cocoon2/src/java/org/apache/cocoon/transformation/I18nTransformer.java
  
  Index: I18nTransformer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/transformation/I18nTransformer.java,v
  retrieving revision 1.13.2.2
  retrieving revision 1.13.2.3
  diff -u -r1.13.2.2 -r1.13.2.3
  --- I18nTransformer.java	5 May 2002 17:33:19 -0000	1.13.2.2
  +++ I18nTransformer.java	30 May 2002 11:55:23 -0000	1.13.2.3
  @@ -225,7 +225,7 @@
    * @author <a href="mailto:Marcus.Crafter@managesoft.com">Marcus Crafter</a>
    * @author <a href="mailto:Michael.Enke@wincor-nixdorf.com">Michael Enke</a>
    * @author <a href="mailto:lassi.immonen@valkeus.com">Lassi Immonen</a>
  - * @version CVS $Id: I18nTransformer.java,v 1.13.2.2 2002/05/05 17:33:19 froehlich Exp
$
  + * @version CVS $Id: I18nTransformer.java,v 1.13.2.3 2002/05/30 11:55:23 kpiroumian Exp
$
    *
    * @todo Move all formatting/parsing routines to I18nUtils
    */
  @@ -1433,7 +1433,7 @@
           char dec = from_fmt.getDecimalFormatSymbols().getDecimalSeparator();
           int decAt = 0;
           boolean appendDec = false;
  -        if (type == null) {
  +        if (type == null || type.equals( I18N_NUMBER_ELEMENT )) {
               to_fmt = (DecimalFormat)NumberFormat.getInstance(loc);
               to_fmt.setMaximumFractionDigits(309);
               for (int i = value.length() - 1;
  @@ -1476,6 +1476,8 @@
               to_fmt.setMaximumFractionDigits(tmp.getMaximumFractionDigits());
           } else if (type.equals( I18N_PERCENT_ELEMENT )) {
               to_fmt = (DecimalFormat)NumberFormat.getPercentInstance(loc);
  +        } else {
  +            throw new SAXException("&lt;i18n:number>: unknown type: " + type);
           }
   
           if(fractionDigits > -1) {
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message