publicstaticvoid main(String[] args) {
Locale reservedLocale = Locale.getDefault(); if (TestUtils.hasSpecialVariant(reservedLocale)) {
System.out.println("Skipping this test because locale is " + reservedLocale); return;
}
privatestaticvoid checkDefault() { if (!base.equals(Locale.getDefault()) ||
!disp.equals(Locale.getDefault(Locale.Category.DISPLAY)) ||
!fmt.equals(Locale.getDefault(Locale.Category.FORMAT))) { thrownew RuntimeException("Some of the return values from "
+ "getDefault() do not agree with the locale derived "
+ "from \"user.xxxx\" system properties");
}
}
Locale.setDefault(Locale.CHINA); if (!Locale.CHINA.equals(Locale.getDefault(Locale.Category.DISPLAY)) ||
!Locale.CHINA.equals(Locale.getDefault(Locale.Category.FORMAT))) { thrownew RuntimeException("setDefault() should set all default "
+ "locales for all categories");
}
}
// make sure JRE has zh_Hans_CN localized string if (zh_Hans_CN.getDisplayScript(Locale.US)
.equals(zh_Hans_CN.getDisplayScript(zh_Hans_CN))) { return;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.