changeset 49297:d8057fc6fffc

8198970: jnu_util.c compilation error on Solaris Reviewed-by: mchung, redestad
author rriggs
date Fri, 02 Mar 2018 18:08:50 -0500
parents fc16b5f193c7
children 6abbc1f5c2a1
files src/java.base/share/native/libjava/jni_util.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/native/libjava/jni_util.c	Fri Mar 02 18:10:57 2018 -0400
+++ b/src/java.base/share/native/libjava/jni_util.c	Fri Mar 02 18:08:50 2018 -0500
@@ -803,10 +803,10 @@
             (strcmp(encname, "ISO-8859-1") == 0)) {
             fastEncoding = FAST_8859_1;
         } else if (strcmp(encname, "UTF-8") == 0) {
-            fastEncoding = FAST_UTF_8;
             jstring enc = (*env)->NewStringUTF(env, encname);
             if (enc == NULL)
                 return;
+            fastEncoding = FAST_UTF_8;
             jnuEncoding = (jstring)(*env)->NewGlobalRef(env, enc);
             (*env)->DeleteLocalRef(env, enc);
         } else if (strcmp(encname, "ISO646-US") == 0) {
@@ -818,10 +818,10 @@
             strcmp(encname, "utf-16le") == 0) {
             fastEncoding = FAST_CP1252;
         } else {
-            fastEncoding = NO_FAST_ENCODING;
             jstring enc = (*env)->NewStringUTF(env, encname);
             if (enc == NULL)
                 return;
+            fastEncoding = NO_FAST_ENCODING;
             jnuEncoding = (jstring)(*env)->NewGlobalRef(env, enc);
             (*env)->DeleteLocalRef(env, enc);
         }