You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Richard Liang <ri...@gmail.com> on 2006/08/11 08:24:11 UTC

[classlib][String] Request for fixing bug in String(byte[] bytes, int offset, int length, String charsetName)

Hello All,

The constructor "String(byte[] bytes, int offset, int length, String 
charsetName)" has the same bug as Harmony-487[1]. When the charsetName 
is "", RI throws UnsupportedEncodingException, but Harmony throws 
IllegalCharsetNameException.

If there is no objection, I will raise a JIRA and provide a patch for 
this issue. Thanks a lot.

The following test passes on RI, but fails on Harmony:
        try {
            String str = new String(new byte[] {0x41, 0x42}, 0, 2, "");
            fail("Should throw UnsupportedEncodingException");
        } catch (UnsupportedEncodingException e) {
            //expected
        }

[1]http://issues.apache.org/jira/browse/HARMONY-487

-- 
Richard Liang
China Software Development Lab, IBM 



---------------------------------------------------------------------
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


Re: [classlib][String] Request for fixing bug in String(byte[] bytes, int offset, int length, String charsetName)

Posted by Richard Liang <ri...@gmail.com>.

Geir Magnusson Jr wrote:
> Never worry if there will be an objection to you raising a JIRA and
> providing a patch.    Just Do It!
>
>   
Thanks  a lot, Geir.

HARMONY-1157 was raised. And Tim had applied my patch.


Best regards,
Richard
> :)
>
> geir
>
>
> Richard Liang wrote:
>   
>> Hello All,
>>
>> The constructor "String(byte[] bytes, int offset, int length, String
>> charsetName)" has the same bug as Harmony-487[1]. When the charsetName
>> is "", RI throws UnsupportedEncodingException, but Harmony throws
>> IllegalCharsetNameException.
>>
>> If there is no objection, I will raise a JIRA and provide a patch for
>> this issue. Thanks a lot.
>>
>> The following test passes on RI, but fails on Harmony:
>>        try {
>>            String str = new String(new byte[] {0x41, 0x42}, 0, 2, "");
>>            fail("Should throw UnsupportedEncodingException");
>>        } catch (UnsupportedEncodingException e) {
>>            //expected
>>        }
>>
>> [1]http://issues.apache.org/jira/browse/HARMONY-487
>>
>>     
>
> ---------------------------------------------------------------------
> 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
>
>
>   

-- 
Richard Liang
China Software Development Lab, IBM 


Re: [classlib][String] Request for fixing bug in String(byte[] bytes, int offset, int length, String charsetName)

Posted by Geir Magnusson Jr <ge...@pobox.com>.
Never worry if there will be an objection to you raising a JIRA and
providing a patch.    Just Do It!

:)

geir


Richard Liang wrote:
> Hello All,
> 
> The constructor "String(byte[] bytes, int offset, int length, String
> charsetName)" has the same bug as Harmony-487[1]. When the charsetName
> is "", RI throws UnsupportedEncodingException, but Harmony throws
> IllegalCharsetNameException.
> 
> If there is no objection, I will raise a JIRA and provide a patch for
> this issue. Thanks a lot.
> 
> The following test passes on RI, but fails on Harmony:
>        try {
>            String str = new String(new byte[] {0x41, 0x42}, 0, 2, "");
>            fail("Should throw UnsupportedEncodingException");
>        } catch (UnsupportedEncodingException e) {
>            //expected
>        }
> 
> [1]http://issues.apache.org/jira/browse/HARMONY-487
> 

---------------------------------------------------------------------
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