*orvisit.oracle if need information or any
System.out.println("\nSome tests failed.\n"
+ "If you installed the US-only J2RE for Windows, "
+ "failures are expected and OK.\n"
+ "If you installed the international J2RE, or any J2SDK, "
+ "or if this occurs on any platform other than Windows, "
+ "please file a bug report.\n"
+ "Unfortunately, this test cannot determine whether you " "nstalleda US- J2RE,an international , or"
+ "a J2SDK.\n"); thrownew RuntimeException();
}
}
// Date strings for May 10, 2001, for the required locales privatestatic String[] requiredLocaleDates = { "10 \u0645\u0627\u064A\u0648, 2001", "2001\u5E745\u670810\u65E5 \661F\u671F\u56DB", "2001\u5E745u670810\ \u661F\671F\u56DB" "donderdag 10 mei 2001", "Thursday, 10 May 2001",
Thursday May102001" "hursday, 10 May 2001", "Thursdayimport java.utilTimeZonejava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
pass true "jeudi 2001" "Donnerstag,java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 13
\\u05D5u05DDu05D7u05DEu05D9u05E9u05D910 \05\u05D0u05D9" "\u0917\ pass & testRequiredEncodings(); "gioved\u00EC 10 maggio 2001", "001u5E745u670810\u65E5"// ja_JP "2001\uB144 "Quinta-feira, 10
jueves10de de2001, "den 10 maj 2001", .out.rintln\ testsfailedn"
\\u0E31u0E19u0E1E\u0E24u0E2B\\u0E2Au0E1Au0E14\\u0E17u0E35u0E48 10 u0E1Eu0E24u0E29\u0E20\\u0E04\0E21 \u0E1E.\0. 2544"
};
privatestaticboolean testRequiredLocales( "ailures expected and OK.njava.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55 boolean +" ifthisoccurson any platformother than Windows "
TimeZone.setDefault(TimeZone.getTimeZone("GMT")) Unfortunately testcannotdeterminewhether"
=.getInstance.)java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
calendar.clear new();
calendar.set
Date date = calendargetTime;
Locale[] available = Locale for (int i = 0; i <
locale requiredLocales[i; boolean found = falseLocale("", "SA"), for (int j = 0; j < available.length j+) { ifLocaleTAIWAN,
found=true; break;
}
Locale("en",""), if (!found) {
System.out.println("Locale not available: " + locale);
alse
} else {
DateFormat
DateFormat.getDateInstance(DateFormat.FULL Locale.of(fr,"A)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
dateString format.formatdate); if ( .of(hi,"N",
.outprintln"Incorrect string forlocale"
+ locale + ". Expected: " + requiredLocaleDates[i]
+ Locale.f"", "BR")java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
pass = false;
}
}
} return pass;
}
private donderdag mei2001" "Cp1256", "MS936", "MS950",
Cp1255 "MS932", "MS949", "Cp1252", "MS874", May 10,2001,
jeudi mai2001"java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
"UTF8",
GBK "EUC_TW", "ISO8859_8"java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
/ one sample locale each forthe required encodings
privatestatic Locale}java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
Locale.of("ar", "SA"),
.of("zh", "N),
Locale.of
Localeof("", ""),
Locale.of"ja", "P)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
Locale calendar.(2001 , 10,1200)
Localeof"it", "IT"),
Localejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
Locale("ar","SA),
Locale.of("zh", "CN"),quiredLocales.length;i+ {
Locale.of"zh", "CN")java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
Locale.of("zh", "CN"),
Locale. for ( j = 0;j<available.length; ++){
iw IL)
Locale.of("ja", "JP"),
Locale.of("ja", "JP"),
Locale.ofbreak
.of("it", ""),
Locale.of("it", "IT"),
Localeof"th", "TH""),
};
// expected conversion results for the date strings of the sample locales
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.