Replacing deprecated String constructor

Xueming Shen xueming.shen at oracle.com
Wed Dec 26 15:29:44 UTC 2012


Yes,  they should be equivalent, except the performance will be slightly 
different. The
"deprecated" one is faster. And  in most cases, the new String(..., 
String charsetName)
version is faster than the new String(..., Charset cs) version.

-sherman


On 12/26/2012 9:50 AM, mikhail cherkasov wrote:
> Hi All,
>
> I work on removing javac's warring and not sure about how
> properly replace deprecated String constructors.
>
> Is 'new String(data, off, len, StandardCharsets.ISO_8859_1)' 
> equivalent replacement for 'new String(data, 0, off, len)' ?
>
> Thanks,
> Mikhail.



More information about the core-libs-dev mailing list