Resolved default charset warning in jetty-util for #2206

Ignored warning in B64Code
US-ASCII in UnixCrypt

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
Lachlan Roberts 2018-02-27 11:09:47 +11:00
parent be64f322ad
commit cf5b501254
2 changed files with 4 additions and 1 deletions

View File

@ -261,6 +261,7 @@ public class B64Code
* @throws IllegalArgumentException if the input is not a valid
* B64 encoding.
*/
@SuppressWarnings("DefaultCharset")
public static String decode(String encoded,String charEncoding)
{
byte[] decoded=decode(encoded);
@ -279,6 +280,7 @@ public class B64Code
* @throws IllegalArgumentException if the input is not a valid
* B64 encoding.
*/
@SuppressWarnings("DefaultCharset")
public static String decode(String encoded, Charset charEncoding)
{
byte[] decoded=decode(encoded);

View File

@ -23,6 +23,7 @@
package org.eclipse.jetty.util.security;
import java.nio.charset.StandardCharsets;
/* ------------------------------------------------------------ */
/**
@ -444,7 +445,7 @@ public class UnixCrypt
rsltblock >>= 6;
}
return new String(cryptresult, 0, 13);
return new String(cryptresult, 0, 13, StandardCharsets.US_ASCII);
}
public static void main(String[] arg)