Changeset 7468


Ignore:
Timestamp:
09/09/10 14:28:14 (9 years ago)
Author:
mnagni
Message:

Now the message formatter load by default the default ResourceBundle?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • RevitalizationWS/common/core/trunk/src/main/java/ndg/common/MessageFormatter.java

    r7315 r7468  
    22 
    33import java.text.MessageFormat; 
     4import java.util.MissingResourceException; 
    45import java.util.ResourceBundle; 
    56 
     
    2425         
    2526        /** 
    26          * Constructs a new instance with an empty <code>ResourceBundle</code>  
     27         * Constructs a new instance with an empty <code>ResourceBundle</code> 
    2728         * */    
    2829        public MessageFormatter() { 
     
    3132 
    3233        /** 
    33          * Constructs a new instance with a define default  
     34         * Constructs a new instance with a defined default  
    3435         * <code>ResourceBundle</code> 
    3536         *  
     
    9394                String text = msg.getMsgKey(); 
    9495                if (resourceBundle != null) 
    95                         resourceBundle.getString(msg.getMsgKey()); 
     96                        text = resourceBundle.getString(msg.getMsgKey()); 
    9697                 
    9798                formatter.applyPattern(text); 
     
    134135        private final ResourceBundle getResourceBundle() throws ResourceNotAvailable { 
    135136                if (resourceBundle == null) { 
    136                         logger.error("The resource bundle is not available"); 
    137                         throw new ResourceNotAvailable(); 
     137                        try { 
     138                                resourceBundle = ResourceBundle.getBundle(NdgDictionary.RESOURCE_BUNDLE); 
     139                        } catch (MissingResourceException ex) { 
     140                                logger.error("No resource bundle could be found!"); 
     141                        } 
    138142                }                        
    139143                return resourceBundle; 
Note: See TracChangeset for help on using the changeset viewer.