maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject cvs commit: jakarta-turbine-maven/src/java/org/apache/maven MavenUtils.java
Date Tue, 10 Dec 2002 23:03:04 GMT
jvanzyl     2002/12/10 15:03:04

  Modified:    src/java/org/apache/maven MavenUtils.java
  Log:
  o Patch for MAVEN-172.
  
  Revision  Changes    Path
  1.75      +15 -10    jakarta-turbine-maven/src/java/org/apache/maven/MavenUtils.java
  
  Index: MavenUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/MavenUtils.java,v
  retrieving revision 1.74
  retrieving revision 1.75
  diff -u -r1.74 -r1.75
  --- MavenUtils.java	10 Dec 2002 15:46:51 -0000	1.74
  +++ MavenUtils.java	10 Dec 2002 23:03:04 -0000	1.75
  @@ -100,6 +100,7 @@
   import java.util.Properties;
   import java.util.Set;
   import java.util.ResourceBundle;
  +import java.util.MissingResourceException;
   import java.util.Locale;
   
   /**
  @@ -823,20 +824,25 @@
   
       /** Resource bundle with user messages. */
       private static ResourceBundle messages;
  -
  +    
  +    /**
  +     * Load Maven user messages from a resource bundle given the
  +     * user's locale.
  +     */
       private static void loadMessages()
       {
  -        // Look for the message bundle corresponding to the user's locale.
  -        messages = ResourceBundle.getBundle( "org/apache/maven/messages/messages" );
  -
  -        // If we can't find the appropriate message bundle for the locale then
  -        // we will fall back to English.
  -        if ( messages == null )
  +        try 
  +        {
  +            // Look for the message bundle corresponding to the user's locale.
  +            messages = ResourceBundle.getBundle( "org/apache/maven/messages/messages" );
  +        } 
  +        catch( MissingResourceException e ) 
           {
  +            // If we can't find the appropriate message bundle for the locale then
  +            // we will fall back to English.
               messages = ResourceBundle.getBundle( "org/apache/maven/messages/messages",
                                                    Locale.ENGLISH );
           }
  -
       }
   
       /**
  @@ -874,6 +880,5 @@
                                           "${1}",
                                           variable.toString() );
           }
  -
       }
   }
  
  
  

Mime
View raw message