public static boolean isCharsetSupported ( String charset ) { Boolean supported = ( Boolean ) supportedEncodingsCache . get ( charset ) ; if ( supported != null ) { return supported . booleanValue ( ) ; } try { new String ( TEST_CHAR , charset ) ; supportedEncodingsCache . put ( charset , Boolean . TRUE ) ; } catch ( UnsupportedEncodingException e ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "isCharsetSupported" , "Encountered UnsupportedEncoding charset [" + charset + "]" ) ; } supportedEncodingsCache . put ( charset , Boolean . FALSE ) ; return false ; } return true ; }
rewritten as part of PK13492