8282897: Fix call parameter to GetStringChars() in HostLocaleProviderAdapter_md.c
Reviewed-by: shade, naoto
This commit is contained in:
parent
fdce97df5f
commit
879b6445e3
@ -243,7 +243,7 @@ JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapte
|
|||||||
JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getDateTimePattern
|
JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getDateTimePattern
|
||||||
(JNIEnv *env, jclass cls, jint dateStyle, jint timeStyle, jstring jlangtag) {
|
(JNIEnv *env, jclass cls, jint dateStyle, jint timeStyle, jstring jlangtag) {
|
||||||
WCHAR pattern[BUFLEN];
|
WCHAR pattern[BUFLEN];
|
||||||
const jchar *langtag = (*env)->GetStringChars(env, jlangtag, JNI_FALSE);
|
const jchar *langtag = (*env)->GetStringChars(env, jlangtag, NULL);
|
||||||
CHECK_NULL_RETURN(langtag, NULL);
|
CHECK_NULL_RETURN(langtag, NULL);
|
||||||
|
|
||||||
pattern[0] = L'\0';
|
pattern[0] = L'\0';
|
||||||
@ -274,7 +274,7 @@ JNIEXPORT jint JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterIm
|
|||||||
(JNIEnv *env, jclass cls, jstring jlangtag) {
|
(JNIEnv *env, jclass cls, jstring jlangtag) {
|
||||||
const jchar *langtag;
|
const jchar *langtag;
|
||||||
jint ret;
|
jint ret;
|
||||||
langtag = (*env)->GetStringChars(env, jlangtag, JNI_FALSE);
|
langtag = (*env)->GetStringChars(env, jlangtag, NULL);
|
||||||
CHECK_NULL_RETURN(langtag, 0);
|
CHECK_NULL_RETURN(langtag, 0);
|
||||||
ret = getCalendarID(langtag);
|
ret = getCalendarID(langtag);
|
||||||
(*env)->ReleaseStringChars(env, jlangtag, langtag);
|
(*env)->ReleaseStringChars(env, jlangtag, langtag);
|
||||||
@ -362,7 +362,7 @@ JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapte
|
|||||||
jstring ret;
|
jstring ret;
|
||||||
WCHAR * pattern;
|
WCHAR * pattern;
|
||||||
|
|
||||||
langtag = (*env)->GetStringChars(env, jlangtag, JNI_FALSE);
|
langtag = (*env)->GetStringChars(env, jlangtag, NULL);
|
||||||
CHECK_NULL_RETURN(langtag, NULL);
|
CHECK_NULL_RETURN(langtag, NULL);
|
||||||
pattern = getNumberPattern(langtag, numberStyle);
|
pattern = getNumberPattern(langtag, numberStyle);
|
||||||
CHECK_NULL_RETURN(pattern, NULL);
|
CHECK_NULL_RETURN(pattern, NULL);
|
||||||
@ -383,7 +383,7 @@ JNIEXPORT jboolean JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapt
|
|||||||
(JNIEnv *env, jclass cls, jstring jlangtag) {
|
(JNIEnv *env, jclass cls, jstring jlangtag) {
|
||||||
DWORD num;
|
DWORD num;
|
||||||
int got;
|
int got;
|
||||||
const jchar *langtag = (*env)->GetStringChars(env, jlangtag, JNI_FALSE);
|
const jchar *langtag = (*env)->GetStringChars(env, jlangtag, NULL);
|
||||||
CHECK_NULL_RETURN(langtag, JNI_FALSE);
|
CHECK_NULL_RETURN(langtag, JNI_FALSE);
|
||||||
got = getLocaleInfoWrapper(langtag,
|
got = getLocaleInfoWrapper(langtag,
|
||||||
LOCALE_IDIGITSUBSTITUTION | LOCALE_RETURN_NUMBER,
|
LOCALE_IDIGITSUBSTITUTION | LOCALE_RETURN_NUMBER,
|
||||||
@ -402,7 +402,7 @@ JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapte
|
|||||||
(JNIEnv *env, jclass cls, jstring jlangtag, jstring currencySymbol) {
|
(JNIEnv *env, jclass cls, jstring jlangtag, jstring currencySymbol) {
|
||||||
WCHAR buf[BUFLEN];
|
WCHAR buf[BUFLEN];
|
||||||
int got;
|
int got;
|
||||||
const jchar *langtag = (*env)->GetStringChars(env, jlangtag, JNI_FALSE);
|
const jchar *langtag = (*env)->GetStringChars(env, jlangtag, NULL);
|
||||||
CHECK_NULL_RETURN(langtag, currencySymbol);
|
CHECK_NULL_RETURN(langtag, currencySymbol);
|
||||||
got = getLocaleInfoWrapper(langtag, LOCALE_SCURRENCY, buf, BUFLEN);
|
got = getLocaleInfoWrapper(langtag, LOCALE_SCURRENCY, buf, BUFLEN);
|
||||||
(*env)->ReleaseStringChars(env, jlangtag, langtag);
|
(*env)->ReleaseStringChars(env, jlangtag, langtag);
|
||||||
@ -423,7 +423,7 @@ JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterI
|
|||||||
(JNIEnv *env, jclass cls, jstring jlangtag, jchar decimalSeparator) {
|
(JNIEnv *env, jclass cls, jstring jlangtag, jchar decimalSeparator) {
|
||||||
WCHAR buf[BUFLEN];
|
WCHAR buf[BUFLEN];
|
||||||
int got;
|
int got;
|
||||||
const jchar *langtag = (*env)->GetStringChars(env, jlangtag, JNI_FALSE);
|
const jchar *langtag = (*env)->GetStringChars(env, jlangtag, NULL);
|
||||||
CHECK_NULL_RETURN(langtag, decimalSeparator);
|
CHECK_NULL_RETURN(langtag, decimalSeparator);
|
||||||
got = getLocaleInfoWrapper(langtag, LOCALE_SDECIMAL, buf, BUFLEN);
|
got = getLocaleInfoWrapper(langtag, LOCALE_SDECIMAL, buf, BUFLEN);
|
||||||
(*env)->ReleaseStringChars(env, jlangtag, langtag);
|
(*env)->ReleaseStringChars(env, jlangtag, langtag);
|
||||||
@ -444,7 +444,7 @@ JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterI
|
|||||||
(JNIEnv *env, jclass cls, jstring jlangtag, jchar groupingSeparator) {
|
(JNIEnv *env, jclass cls, jstring jlangtag, jchar groupingSeparator) {
|
||||||
WCHAR buf[BUFLEN];
|
WCHAR buf[BUFLEN];
|
||||||
int got;
|
int got;
|
||||||
const jchar *langtag = (*env)->GetStringChars(env, jlangtag, JNI_FALSE);
|
const jchar *langtag = (*env)->GetStringChars(env, jlangtag, NULL);
|
||||||
CHECK_NULL_RETURN(langtag, groupingSeparator);
|
CHECK_NULL_RETURN(langtag, groupingSeparator);
|
||||||
got = getLocaleInfoWrapper(langtag, LOCALE_STHOUSAND, buf, BUFLEN);
|
got = getLocaleInfoWrapper(langtag, LOCALE_STHOUSAND, buf, BUFLEN);
|
||||||
(*env)->ReleaseStringChars(env, jlangtag, langtag);
|
(*env)->ReleaseStringChars(env, jlangtag, langtag);
|
||||||
@ -465,7 +465,7 @@ JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapte
|
|||||||
(JNIEnv *env, jclass cls, jstring jlangtag, jstring infinity) {
|
(JNIEnv *env, jclass cls, jstring jlangtag, jstring infinity) {
|
||||||
WCHAR buf[BUFLEN];
|
WCHAR buf[BUFLEN];
|
||||||
int got;
|
int got;
|
||||||
const jchar *langtag = (*env)->GetStringChars(env, jlangtag, JNI_FALSE);
|
const jchar *langtag = (*env)->GetStringChars(env, jlangtag, NULL);
|
||||||
CHECK_NULL_RETURN(langtag, infinity);
|
CHECK_NULL_RETURN(langtag, infinity);
|
||||||
got = getLocaleInfoWrapper(langtag, LOCALE_SPOSINFINITY, buf, BUFLEN);
|
got = getLocaleInfoWrapper(langtag, LOCALE_SPOSINFINITY, buf, BUFLEN);
|
||||||
(*env)->ReleaseStringChars(env, jlangtag, langtag);
|
(*env)->ReleaseStringChars(env, jlangtag, langtag);
|
||||||
@ -486,7 +486,7 @@ JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapte
|
|||||||
(JNIEnv *env, jclass cls, jstring jlangtag, jstring internationalCurrencySymbol) {
|
(JNIEnv *env, jclass cls, jstring jlangtag, jstring internationalCurrencySymbol) {
|
||||||
WCHAR buf[BUFLEN];
|
WCHAR buf[BUFLEN];
|
||||||
int got;
|
int got;
|
||||||
const jchar *langtag = (*env)->GetStringChars(env, jlangtag, JNI_FALSE);
|
const jchar *langtag = (*env)->GetStringChars(env, jlangtag, NULL);
|
||||||
CHECK_NULL_RETURN(langtag, internationalCurrencySymbol);
|
CHECK_NULL_RETURN(langtag, internationalCurrencySymbol);
|
||||||
got = getLocaleInfoWrapper(langtag, LOCALE_SINTLSYMBOL, buf, BUFLEN);
|
got = getLocaleInfoWrapper(langtag, LOCALE_SINTLSYMBOL, buf, BUFLEN);
|
||||||
(*env)->ReleaseStringChars(env, jlangtag, langtag);
|
(*env)->ReleaseStringChars(env, jlangtag, langtag);
|
||||||
@ -507,7 +507,7 @@ JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterI
|
|||||||
(JNIEnv *env, jclass cls, jstring jlangtag, jchar minusSign) {
|
(JNIEnv *env, jclass cls, jstring jlangtag, jchar minusSign) {
|
||||||
WCHAR buf[BUFLEN];
|
WCHAR buf[BUFLEN];
|
||||||
int got;
|
int got;
|
||||||
const jchar *langtag = (*env)->GetStringChars(env, jlangtag, JNI_FALSE);
|
const jchar *langtag = (*env)->GetStringChars(env, jlangtag, NULL);
|
||||||
CHECK_NULL_RETURN(langtag, minusSign);
|
CHECK_NULL_RETURN(langtag, minusSign);
|
||||||
got = getLocaleInfoWrapper(langtag, LOCALE_SNEGATIVESIGN, buf, BUFLEN);
|
got = getLocaleInfoWrapper(langtag, LOCALE_SNEGATIVESIGN, buf, BUFLEN);
|
||||||
(*env)->ReleaseStringChars(env, jlangtag, langtag);
|
(*env)->ReleaseStringChars(env, jlangtag, langtag);
|
||||||
@ -528,7 +528,7 @@ JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterI
|
|||||||
(JNIEnv *env, jclass cls, jstring jlangtag, jchar monetaryDecimalSeparator) {
|
(JNIEnv *env, jclass cls, jstring jlangtag, jchar monetaryDecimalSeparator) {
|
||||||
WCHAR buf[BUFLEN];
|
WCHAR buf[BUFLEN];
|
||||||
int got;
|
int got;
|
||||||
const jchar *langtag = (*env)->GetStringChars(env, jlangtag, JNI_FALSE);
|
const jchar *langtag = (*env)->GetStringChars(env, jlangtag, NULL);
|
||||||
CHECK_NULL_RETURN(langtag, monetaryDecimalSeparator);
|
CHECK_NULL_RETURN(langtag, monetaryDecimalSeparator);
|
||||||
got = getLocaleInfoWrapper(langtag, LOCALE_SMONDECIMALSEP, buf, BUFLEN);
|
got = getLocaleInfoWrapper(langtag, LOCALE_SMONDECIMALSEP, buf, BUFLEN);
|
||||||
(*env)->ReleaseStringChars(env, jlangtag, langtag);
|
(*env)->ReleaseStringChars(env, jlangtag, langtag);
|
||||||
@ -549,7 +549,7 @@ JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapte
|
|||||||
(JNIEnv *env, jclass cls, jstring jlangtag, jstring nan) {
|
(JNIEnv *env, jclass cls, jstring jlangtag, jstring nan) {
|
||||||
WCHAR buf[BUFLEN];
|
WCHAR buf[BUFLEN];
|
||||||
int got;
|
int got;
|
||||||
const jchar *langtag = (*env)->GetStringChars(env, jlangtag, JNI_FALSE);
|
const jchar *langtag = (*env)->GetStringChars(env, jlangtag, NULL);
|
||||||
CHECK_NULL_RETURN(langtag, nan);
|
CHECK_NULL_RETURN(langtag, nan);
|
||||||
got = getLocaleInfoWrapper(langtag, LOCALE_SNAN, buf, BUFLEN);
|
got = getLocaleInfoWrapper(langtag, LOCALE_SNAN, buf, BUFLEN);
|
||||||
(*env)->ReleaseStringChars(env, jlangtag, langtag);
|
(*env)->ReleaseStringChars(env, jlangtag, langtag);
|
||||||
@ -570,7 +570,7 @@ JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterI
|
|||||||
(JNIEnv *env, jclass cls, jstring jlangtag, jchar percent) {
|
(JNIEnv *env, jclass cls, jstring jlangtag, jchar percent) {
|
||||||
WCHAR buf[BUFLEN];
|
WCHAR buf[BUFLEN];
|
||||||
int got;
|
int got;
|
||||||
const jchar *langtag = (*env)->GetStringChars(env, jlangtag, JNI_FALSE);
|
const jchar *langtag = (*env)->GetStringChars(env, jlangtag, NULL);
|
||||||
CHECK_NULL_RETURN(langtag, percent);
|
CHECK_NULL_RETURN(langtag, percent);
|
||||||
got = getLocaleInfoWrapper(langtag, LOCALE_SPERCENT, buf, BUFLEN);
|
got = getLocaleInfoWrapper(langtag, LOCALE_SPERCENT, buf, BUFLEN);
|
||||||
(*env)->ReleaseStringChars(env, jlangtag, langtag);
|
(*env)->ReleaseStringChars(env, jlangtag, langtag);
|
||||||
@ -592,7 +592,7 @@ JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterI
|
|||||||
WCHAR buf[BUFLEN];
|
WCHAR buf[BUFLEN];
|
||||||
const jchar *langtag;
|
const jchar *langtag;
|
||||||
int got;
|
int got;
|
||||||
langtag = (*env)->GetStringChars(env, jlangtag, JNI_FALSE);
|
langtag = (*env)->GetStringChars(env, jlangtag, NULL);
|
||||||
CHECK_NULL_RETURN(langtag, perMill);
|
CHECK_NULL_RETURN(langtag, perMill);
|
||||||
got = getLocaleInfoWrapper(langtag, LOCALE_SPERMILLE, buf, BUFLEN);
|
got = getLocaleInfoWrapper(langtag, LOCALE_SPERMILLE, buf, BUFLEN);
|
||||||
|
|
||||||
@ -615,7 +615,7 @@ JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterI
|
|||||||
WCHAR buf[BUFLEN];
|
WCHAR buf[BUFLEN];
|
||||||
const jchar *langtag;
|
const jchar *langtag;
|
||||||
int got;
|
int got;
|
||||||
langtag = (*env)->GetStringChars(env, jlangtag, JNI_FALSE);
|
langtag = (*env)->GetStringChars(env, jlangtag, NULL);
|
||||||
CHECK_NULL_RETURN(langtag, zeroDigit);
|
CHECK_NULL_RETURN(langtag, zeroDigit);
|
||||||
got = getLocaleInfoWrapper(langtag, LOCALE_SNATIVEDIGITS, buf, BUFLEN);
|
got = getLocaleInfoWrapper(langtag, LOCALE_SNATIVEDIGITS, buf, BUFLEN);
|
||||||
|
|
||||||
@ -639,7 +639,7 @@ JNIEXPORT jint JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterIm
|
|||||||
const jchar *langtag;
|
const jchar *langtag;
|
||||||
int got = 0;
|
int got = 0;
|
||||||
|
|
||||||
langtag = (*env)->GetStringChars(env, jlangtag, JNI_FALSE);
|
langtag = (*env)->GetStringChars(env, jlangtag, NULL);
|
||||||
CHECK_NULL_RETURN(langtag, -1);
|
CHECK_NULL_RETURN(langtag, -1);
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case sun_util_locale_provider_HostLocaleProviderAdapterImpl_CD_FIRSTDAYOFWEEK:
|
case sun_util_locale_provider_HostLocaleProviderAdapterImpl_CD_FIRSTDAYOFWEEK:
|
||||||
@ -756,7 +756,7 @@ JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapte
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
pjChar = (*env)->GetStringChars(env, jStr, JNI_FALSE);
|
pjChar = (*env)->GetStringChars(env, jStr, NULL);
|
||||||
CHECK_NULL_RETURN(pjChar, NULL);
|
CHECK_NULL_RETURN(pjChar, NULL);
|
||||||
got = getLocaleInfoWrapper(pjChar, lcType, buf, BUFLEN);
|
got = getLocaleInfoWrapper(pjChar, lcType, buf, BUFLEN);
|
||||||
(*env)->ReleaseStringChars(env, jStr, pjChar);
|
(*env)->ReleaseStringChars(env, jStr, pjChar);
|
||||||
@ -833,7 +833,7 @@ jint getCalendarID(const jchar *langtag) {
|
|||||||
|
|
||||||
void replaceCalendarArrayElems(JNIEnv *env, jstring jlangtag, jint calid, jobjectArray jarray, DWORD* pTypes, int offset, int length, int style, BOOL bCal) {
|
void replaceCalendarArrayElems(JNIEnv *env, jstring jlangtag, jint calid, jobjectArray jarray, DWORD* pTypes, int offset, int length, int style, BOOL bCal) {
|
||||||
WCHAR name[BUFLEN];
|
WCHAR name[BUFLEN];
|
||||||
const jchar *langtag = (*env)->GetStringChars(env, jlangtag, JNI_FALSE);
|
const jchar *langtag = (*env)->GetStringChars(env, jlangtag, NULL);
|
||||||
jstring tmp_string;
|
jstring tmp_string;
|
||||||
CALTYPE isGenitive = 0;
|
CALTYPE isGenitive = 0;
|
||||||
|
|
||||||
@ -1023,7 +1023,7 @@ BOOL CALLBACK EnumCalendarInfoProc(LPWSTR lpCalInfoStr, CALID calid, LPWSTR lpRe
|
|||||||
}
|
}
|
||||||
|
|
||||||
jobjectArray getErasImpl(JNIEnv *env, jstring jlangtag, jint calid, jint style, jobjectArray eras) {
|
jobjectArray getErasImpl(JNIEnv *env, jstring jlangtag, jint calid, jint style, jobjectArray eras) {
|
||||||
const jchar * langtag = (*env)->GetStringChars(env, jlangtag, JNI_FALSE);
|
const jchar * langtag = (*env)->GetStringChars(env, jlangtag, NULL);
|
||||||
WCHAR buf[BUFLEN];
|
WCHAR buf[BUFLEN];
|
||||||
jobjectArray ret = eras;
|
jobjectArray ret = eras;
|
||||||
CALTYPE type;
|
CALTYPE type;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user