cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject cvs commit: cocoon-2.1/src/java/org/apache/cocoon/matching I18nMatcher.java
Date Mon, 12 Jul 2004 02:25:31 GMT
antonio     2004/07/11 19:25:31

  Modified:    src/java/org/apache/cocoon/matching I18nMatcher.java
  Log:
  Remove unused local variable
  
  Revision  Changes    Path
  1.3       +19 -25    cocoon-2.1/src/java/org/apache/cocoon/matching/I18nMatcher.java
  
  Index: I18nMatcher.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/matching/I18nMatcher.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- I18nMatcher.java	11 Jul 2004 21:28:58 -0000	1.2
  +++ I18nMatcher.java	12 Jul 2004 02:25:31 -0000	1.3
  @@ -117,7 +117,7 @@
       private boolean useLocales;
       private Locale defaultLocale;
       private boolean testBlankLocale;
  -    
  +
       private static final boolean DEFAULT_USE_LOCALE = true;
       private static final boolean DEFAULT_USE_LOCALES = true;
       private static final String DEFAULT_DEFAULT_LANG = "en";
  @@ -125,7 +125,7 @@
       private static final String DEFAULT_DEFAULT_VARIANT = null;
       private static final String DEFAULT_REQUEST_PARAM_NAME = null;
       private static final boolean DEFAULT_TEST_BLANK_LOCALE = true;
  -    
  +
       private static final String MAP_LOCALE = "locale";
       private static final String MAP_LOCALES = "locales";
       private static final String MAP_MATCHED_LOCALE = "matched-locale";
  @@ -134,7 +134,7 @@
       private static final String MAP_LANGUAGE ="language";
       private static final String MAP_VARIANT = "variant";
       private static final String MAP_ENCODING = "encoding";
  -    
  +
       public void service(ServiceManager manager) throws ServiceException {
           this.manager = manager;
           this.resolver = (SourceResolver)this.manager.lookup(SourceResolver.ROLE);
  @@ -172,11 +172,11 @@
           if (country == null) {
               return new Locale(lang, "");
           }
  -        
  +
           if (variant == null) {
               return new Locale(lang, country);
           }
  -        
  +
           return new Locale(lang, country, variant);
       }
   
  @@ -187,21 +187,19 @@
           Enumeration locales = request.getLocales();
           String requestParameter = request.getParameter(requestParameterName);
           String sitemapParameter = parameters.getParameter("locale", null);
  -        
  -        String matchingUrl = null;
  -        
  +
           if (requestParameter != null && isValidResource(pattern, new Locale(requestParameter,
""), map)) {
                return map;
           }
  -        
  +
           if (sitemapParameter != null && isValidResource(pattern, new Locale(sitemapParameter,
""), map)) {
                 return map;
           }
  -        
  +
           if (useLocale && !useLocales && isValidResource(pattern, locale,
map)) {
               return map;
           }
  -        
  +
           if (useLocales) {
               for (; locales.hasMoreElements();) {
                   Locale l = (Locale)locales.nextElement();
  @@ -210,25 +208,24 @@
                   }
               }
           }
  -        
  +
           if (defaultLocale != null && isValidResource(pattern, defaultLocale, map))
{
               return map;
           }
  -        
  +
           if (testBlankLocale && isValidResource(pattern, null, map)) {
               return map;   
           }
  -        
           return null;
       }    
  -    
  +
       private boolean isValidResource(String pattern, Locale locale, Map map) {
           Locale testLocale;
  -        
  +
           if (locale == null) {
               return isValidResource(pattern, null, null, map);   
           }
  -        
  +
           testLocale = locale;
           if (isValidResource(pattern, locale, testLocale.toString(), map)) {
               return true;        
  @@ -238,19 +235,18 @@
           if (isValidResource(pattern, locale, testLocale.toString(), map)) {
               return true;        
           }
  -        
  +
           testLocale = new Locale(locale.getLanguage(), ""); 
           if (isValidResource(pattern, locale, testLocale.toString(), map)) {
               return true;        
           }
  -               
  +
           return false;
  -        
       }
  -    
  +
       private boolean isValidResource(String pattern, Locale locale, String localeString,
Map map) {
           Source source;
  -        
  +
           String url;
           if (localeString!=null) {
               url = StringUtils.replace(pattern, "*", localeString);
  @@ -275,8 +271,6 @@
                       map.put(MAP_COUNTRY, locale.getCountry());
                       map.put(MAP_VARIANT, locale.getVariant());
                   }
  -                //map.put(MAP_ENCODING, "???");
  -
                   result = true;
               }
               resolver.release(source);
  
  
  

Mime
View raw message