harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Beyer" <nbe...@kc.rr.com>
Subject RE: [classlib] request for modification of String.java
Date Thu, 29 Jun 2006 02:47:23 GMT
The patch looks okay to me. Although not a big concern in this case, I like
to propagate the cause of exceptions that are results of other exceptions.
Since this exception doesn't have a cause constructor, you can use
'initCause' like this: throw (UnsupportedEncodingException)(new
UnsupportedEncodingException(encoding).initCause(e);

-Nathan

> -----Original Message-----
> From: Mikhail Loenko [mailto:mloenko@gmail.com]
> Sent: Wednesday, June 28, 2006 7:05 AM
> To: harmony-dev@incubator.apache.org
> Subject: [classlib] request for modification of String.java
> 
> As a fix for H-663 I'd like to apply this patch
> 
> @@ -848,6 +848,8 @@
>  		if (charset == null ||
> !encoding.equalsIgnoreCase(charset.name())) {
>  			try {
>  				charset = Charset.forName(encoding);
> +			} catch (IllegalCharsetNameException e) {
> +			    throw new
UnsupportedEncodingException(encoding);
>  			} catch (UnsupportedCharsetException e) {
>  				throw new
UnsupportedEncodingException(encoding);
>  			}
> 
> 
> Please comment
> 
> Thanks,
> Mikhail
> 
> http://issues.apache.org/jira/browse/HARMONY-663
> 
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message