The method java.nio.charset.Charset.atBugLevel(String bl) and its uses shall be removed completely. This means not honoring the property "sun.nio.cs.bugLevel" at this place any longer. The bugLevel was used here to cause JDK 1.4 compatible behavior which is probably obsolete by now.
The current problem resp. motivation why this should be done is to eliminate a volatile String member which causes performance penalties when accessing the bugLevel() method.
Remove bugLevel() and drop the alternative handling for JDK 1.4 compatibility at the places where it is called.
Alternative would be to reimplement bugLevel() without volatile field.
The change implies that system property "sun.nio.cs.bugLevel" is ignored from now on. Before this change, one could set system property "sun.nio.cs.bugLevel=1.4" which would cause the following exceptional behavior to enable compatibility with JDK 1.4:
a) When a constructor of Charset or any method that checks the supplied charset name is called with an empty name the result would be an UnsupportedCharsetException as opposed to the standard behavior to obtain an IllegalCharsetNameException.
b) When the constructor of CharsetDecoder/CharsetEncoder is called, no check will be done whether the value of argument averageCharsPerByte exceeds the one of argument maxCharsPerByte. Usually one would get an IllegalArgumentException if averageCharsPerByte > maxCharsPerByte.