You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by lu...@apache.org on 2002/04/17 22:51:19 UTC

cvs commit: jakarta-taglibs/standard/src/javax/servlet/jsp/jstl/fmt LocaleSupport.java

luehe       02/04/17 13:51:19

  Modified:    standard/src/javax/servlet/jsp/jstl/fmt LocaleSupport.java
  Log:
  Fixed 8224: NPE occurs if basename attribute of setBundle is null or empty
  
  Revision  Changes    Path
  1.6       +12 -10    jakarta-taglibs/standard/src/javax/servlet/jsp/jstl/fmt/LocaleSupport.java
  
  Index: LocaleSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/src/javax/servlet/jsp/jstl/fmt/LocaleSupport.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- LocaleSupport.java	16 Apr 2002 15:49:50 -0000	1.5
  +++ LocaleSupport.java	17 Apr 2002 20:51:18 -0000	1.6
  @@ -181,17 +181,19 @@
   	    locCtxt = BundleSupport.getLocalizationContext(pc);
   	}
   
  -	ResourceBundle bundle = locCtxt.getResourceBundle();
  -	if (bundle != null) {
  -	    try {
  -		message = bundle.getString(key);
  -		if (args != null) {
  -		    MessageFormat formatter = new MessageFormat("");
  -		    formatter.setLocale(bundle.getLocale());
  -		    formatter.applyPattern(message);
  -		    message = formatter.format(args);
  +	if (locCtxt != null) {
  +	    ResourceBundle bundle = locCtxt.getResourceBundle();
  +	    if (bundle != null) {
  +		try {
  +		    message = bundle.getString(key);
  +		    if (args != null) {
  +			MessageFormat formatter = new MessageFormat("");
  +			formatter.setLocale(bundle.getLocale());
  +			formatter.applyPattern(message);
  +			message = formatter.format(args);
  +		    }
  +		} catch (MissingResourceException mre) {
   		}
  -	    } catch (MissingResourceException mre) {
   	    }
   	}
   
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>