< prev index next >
src/java.base/share/classes/java/nio/charset/Charset.java
Print this page
*** 279,301 ****
implements Comparable<Charset>
{
/* -- Static methods -- */
- private static volatile String bugLevel;
-
- static boolean atBugLevel(String bl) { // package-private
- String level = bugLevel;
- if (level == null) {
- if (!VM.isBooted())
- return false;
- bugLevel = level = GetPropertyAction
- .privilegedGetProperty("sun.nio.cs.bugLevel", "");
- }
- return level.equals(bl);
- }
-
/**
* Checks that the given string is a legal charset name. </p>
*
* @param s
* A purported charset name
--- 279,288 ----
*** 303,313 ****
* @throws IllegalCharsetNameException
* If the given name is not a legal charset name
*/
private static void checkName(String s) {
int n = s.length();
! if (n == 0 && !atBugLevel("1.4")) {
throw new IllegalCharsetNameException(s);
}
for (int i = 0; i < n; i++) {
char c = s.charAt(i);
if (c >= 'A' && c <= 'Z') continue;
--- 290,300 ----
* @throws IllegalCharsetNameException
* If the given name is not a legal charset name
*/
private static void checkName(String s) {
int n = s.length();
! if (n == 0) {
throw new IllegalCharsetNameException(s);
}
for (int i = 0; i < n; i++) {
char c = s.charAt(i);
if (c >= 'A' && c <= 'Z') continue;
< prev index next >