You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by an...@apache.org on 2011/10/09 19:41:22 UTC

svn commit: r1180664 - /cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/I18nTransformer.java

Author: anathaniel
Date: Sun Oct  9 17:41:21 2011
New Revision: 1180664

URL: http://svn.apache.org/viewvc?rev=1180664&view=rev
Log:
Fix warnings

Modified:
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/I18nTransformer.java

Modified: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/I18nTransformer.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/I18nTransformer.java?rev=1180664&r1=1180663&r2=1180664&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/I18nTransformer.java (original)
+++ cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/I18nTransformer.java Sun Oct  9 17:41:21 2011
@@ -54,7 +54,7 @@ import org.xml.sax.helpers.AttributesImp
  * Locale is passed as parameter to the transformer.</p>
  *
  * <p>For the passed local it then attempts to find a resource bundle that
- * satisifies the locale, and uses it for for processing text replacement
+ * satisfies the locale, and uses it for for processing text replacement
  * directed by i18n markup.</p>
  *
  * <h3>Usage</h3>
@@ -70,14 +70,14 @@ import org.xml.sax.helpers.AttributesImp
  *
  * <h3>Pipeline Usage</h3>
  * <p>To use the transformer in a pipeline, simply specify it in a particular
- * transform, and pass locale, budle and (optional) untraslated parameters:
+ * transform, and pass locale, bundle and (optional) untranslated parameters:
  * <pre>
  * &lt;map:match pattern="file"&gt;
  *   &lt;map:generate src="file.xml"/&gt;
  *   &lt;map:transform type="i18n"&gt;
  *     &lt;map:parameter name="locale" value="..."/&gt;
  *     &lt;map:parameter name="bundle" value="..."/&gt;
- *     &lt;map:parameter name="untraslated" value="..."/&gt;
+ *     &lt;map:parameter name="untranslated" value="..."/&gt;
  *   &lt;/map:transform&gt;
  *   &lt;map:serialize/&gt;
  * &lt;/map:match&gt;
@@ -249,7 +249,7 @@ public class I18nTransformer extends Abs
     /**
      * <code>i18n:param</code> is used with i18n:translate to provide
      * substitution params. The param can have <code>i18n:text</code> as
-     * its value to provide multilungual value. Parameters can have
+     * its value to provide multilingual value. Parameters can have
      * additional attributes to be used for formatting:
      * <ul>
      *   <li><code>type</code>: can be <code>date, date-time, time,
@@ -523,8 +523,8 @@ public class I18nTransformer extends Abs
     /**
      * This attribute is used to specify a different locale for the
      * currency. When specified, this locale will be combined with
-     * the "normal" locale: e.g. the seperator symbols are taken from
-     * the normal locale but the currency symbol and possition will
+     * the "normal" locale: e.g. the separator symbols are taken from
+     * the normal locale but the currency symbol and position will
      * be taken from the currency locale.
      * This enables to see a currency formatted for Euro but with US
      * grouping and decimal char.
@@ -588,14 +588,14 @@ public class I18nTransformer extends Abs
 
     static {
         // initialize date types set
-        Set<String> set = new HashSet<String>(3);
+        Set<String> set = new HashSet<String>(3*2+1);
         set.add(ELEM_DATE);
         set.add(ELEM_TIME);
         set.add(ELEM_DATE_TIME);
         DATE_TYPES = Collections.unmodifiableSet(set);
 
         // initialize number types set
-        set = new HashSet<String>(6);
+        set = new HashSet<String>(6*2+1);
         set.add(ELEM_NUMBER);
         set.add(ELEM_PERCENT);
         set.add(ELEM_CURRENCY);
@@ -605,7 +605,7 @@ public class I18nTransformer extends Abs
         NUMBER_TYPES = Collections.unmodifiableSet(set);
 
         // initialize date patterns map
-        final Map<String, Integer> map = new HashMap(4);
+        final Map<String, Integer> map = new HashMap<String, Integer>(4*2+1);
         map.put("SHORT", DateFormat.SHORT);
         map.put("MEDIUM", DateFormat.MEDIUM);
         map.put("LONG", DateFormat.LONG);
@@ -855,6 +855,7 @@ public class I18nTransformer extends Abs
                 case INSIDE_WHEN:
                 case INSIDE_OTHERWISE:
                     super.startElement(uri, name, raw, attr);
+                    break;
 
                 default:
             }
@@ -1344,6 +1345,8 @@ public class I18nTransformer extends Abs
                                     translated.append(value);
                                 }
                                 break;
+                                
+                            default:
                         }
                     }
                 };
@@ -1696,7 +1699,7 @@ public class I18nTransformer extends Abs
         if (currencyLocale != null) {
             // the reasoning here is: if there is a currency locale, then start
             // from that one but take certain properties (like decimal and 
-            // grouping seperation symbols) from the default locale (this happens
+            // grouping separation symbols) from the default locale (this happens
             // further on).
             decimalLocale = dstLocale;
             dstLocale = currencyLocale;
@@ -1725,7 +1728,8 @@ public class I18nTransformer extends Abs
             dstFmt = (DecimalFormat) NumberFormat.getInstance(dstLocale);
             dstFmt.setMaximumFractionDigits(309);
             for (int i = value.length() - 1;
-                    i >= 0 && value.charAt(i) != dec; i--, decAt++) {
+                    i >= 0 && value.charAt(i) != dec; i--) {
+                decAt++;
             }
 
             if (decAt < value.length()) {