You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@turbine.apache.org by pa...@apache.org on 2018/10/08 16:24:11 UTC

svn commit: r1843171 - in /turbine/fulcrum/trunk/localization/src/java/org/apache/fulcrum/localization: LocaleTokenizer.java SimpleLocalizationServiceImpl.java

Author: painter
Date: Mon Oct  8 16:24:11 2018
New Revision: 1843171

URL: http://svn.apache.org/viewvc?rev=1843171&view=rev
Log:
Fix typing issues - minor

Modified:
    turbine/fulcrum/trunk/localization/src/java/org/apache/fulcrum/localization/LocaleTokenizer.java
    turbine/fulcrum/trunk/localization/src/java/org/apache/fulcrum/localization/SimpleLocalizationServiceImpl.java

Modified: turbine/fulcrum/trunk/localization/src/java/org/apache/fulcrum/localization/LocaleTokenizer.java
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/localization/src/java/org/apache/fulcrum/localization/LocaleTokenizer.java?rev=1843171&r1=1843170&r2=1843171&view=diff
==============================================================================
--- turbine/fulcrum/trunk/localization/src/java/org/apache/fulcrum/localization/LocaleTokenizer.java (original)
+++ turbine/fulcrum/trunk/localization/src/java/org/apache/fulcrum/localization/LocaleTokenizer.java Mon Oct  8 16:24:11 2018
@@ -28,6 +28,8 @@ import java.util.Locale;
 import java.util.NoSuchElementException;
 import java.util.StringTokenizer;
 
+import org.apache.fulcrum.localization.LocaleTokenizer.AcceptLanguage;
+
 /**
  * Parses the HTTP <code>Accept-Language</code> header as per section
  * 14.4 of RFC 2068 (HTTP 1.1 header field definitions).
@@ -58,7 +60,7 @@ public class LocaleTokenizer
     /**
      * The parsed locales.
      */
-    private ArrayList locales = new ArrayList(3);
+    private ArrayList<AcceptLanguage> locales = new ArrayList<AcceptLanguage>(3);
 
     /**
      * Parses the <code>Accept-Language</code> header.
@@ -154,7 +156,7 @@ public class LocaleTokenizer
      * Struct representing an element of the HTTP
      * <code>Accept-Language</code> header.
      */
-    protected static class AcceptLanguage implements Comparable
+    protected static class AcceptLanguage implements Comparable<Object>
     {
         /**
          * The language and country.

Modified: turbine/fulcrum/trunk/localization/src/java/org/apache/fulcrum/localization/SimpleLocalizationServiceImpl.java
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/localization/src/java/org/apache/fulcrum/localization/SimpleLocalizationServiceImpl.java?rev=1843171&r1=1843170&r2=1843171&view=diff
==============================================================================
--- turbine/fulcrum/trunk/localization/src/java/org/apache/fulcrum/localization/SimpleLocalizationServiceImpl.java (original)
+++ turbine/fulcrum/trunk/localization/src/java/org/apache/fulcrum/localization/SimpleLocalizationServiceImpl.java Mon Oct  8 16:24:11 2018
@@ -80,7 +80,7 @@ public class SimpleLocalizationServiceIm
      * Bundle name keys a HashMap of the ResourceBundles in this
      * service (which is in turn keyed by Locale).
      */
-    private HashMap bundles = null;
+    private HashMap<String, HashMap<Locale, ResourceBundle>> bundles = null;
     /**
      * The list of default bundles to search.
      */
@@ -104,7 +104,7 @@ public class SimpleLocalizationServiceIm
      */
     public SimpleLocalizationServiceImpl()
     {
-        bundles = new HashMap();
+        bundles = new HashMap<String, HashMap<Locale, ResourceBundle>>();
     }
 
     /**
@@ -283,7 +283,7 @@ public class SimpleLocalizationServiceIm
         }
         // Find/retrieve/cache bundle.
         ResourceBundle rb = null;
-        HashMap bundlesByLocale = (HashMap) bundles.get(bundleName);
+        HashMap<?, ?> bundlesByLocale = (HashMap<?, ?>) bundles.get(bundleName);
         if (bundlesByLocale != null)
         {
             // Cache of bundles by locale for the named bundle exists.
@@ -314,7 +314,7 @@ public class SimpleLocalizationServiceIm
         Locale locale)
         throws MissingResourceException
     {
-        HashMap bundlesByLocale = (HashMap) bundles.get(bundleName);
+        HashMap<Locale, ResourceBundle> bundlesByLocale = (HashMap<Locale, ResourceBundle>) bundles.get(bundleName);
         ResourceBundle rb =
             (bundlesByLocale == null
                 ? null
@@ -323,8 +323,8 @@ public class SimpleLocalizationServiceIm
         {
             bundlesByLocale =
                 (bundlesByLocale == null
-                    ? new HashMap(3)
-                    : new HashMap(bundlesByLocale));
+                    ? new HashMap<Locale, ResourceBundle>(3)
+                    : new HashMap<Locale, ResourceBundle>(bundlesByLocale));
             try
             {
                 rb = ResourceBundle.getBundle(bundleName, locale);
@@ -341,7 +341,7 @@ public class SimpleLocalizationServiceIm
             {
                 // Cache bundle.
                 bundlesByLocale.put(rb.getLocale(), rb);
-                HashMap bundlesByName = new HashMap(bundles);
+                HashMap<String, HashMap<Locale, ResourceBundle>> bundlesByName = new HashMap<String, HashMap<Locale, ResourceBundle>>(bundles);
                 bundlesByName.put(bundleName, bundlesByLocale);
                 this.bundles = bundlesByName;
             }
@@ -367,7 +367,7 @@ public class SimpleLocalizationServiceIm
     private ResourceBundle findBundleByLocale(
         String bundleName,
         Locale locale,
-        Map bundlesByLocale)
+        Map<Locale, ResourceBundle> bundlesByLocale)
     {
         ResourceBundle rb = null;
         if (!StringUtils.isNotEmpty(locale.getCountry())