8198385: Remove property sun.locale.formatasdefault
authornaoto
Wed, 21 Feb 2018 15:09:40 -0800
changeset 48928 cc30928a834e
parent 48927 847a988152b8
child 48929 28d8fc8cd3cd
8198385: Remove property sun.locale.formatasdefault Reviewed-by: bpb
src/java.base/share/native/libjava/System.c
--- a/src/java.base/share/native/libjava/System.c	Wed Feb 21 14:23:45 2018 -0800
+++ b/src/java.base/share/native/libjava/System.c	Wed Feb 21 15:09:40 2018 -0800
@@ -125,7 +125,6 @@
   #define JAVA_SPECIFICATION_VENDOR "Oracle Corporation"
 #endif
 
-static int fmtdefault; // boolean value
 jobject fillI18nProps(JNIEnv *env, jobject props, char *baseKey,
                       char *platformDispVal, char *platformFmtVal,
                       jmethodID putID, jmethodID getPropID) {
@@ -141,16 +140,9 @@
         const char *baseVal = "";
 
         /* user.xxx base property */
-        if (fmtdefault) {
-            if (platformFmtVal) {
-                PUTPROP(props, baseKey, platformFmtVal);
-                baseVal = platformFmtVal;
-            }
-        } else {
-            if (platformDispVal) {
-                PUTPROP(props, baseKey, platformDispVal);
-                baseVal = platformDispVal;
-            }
+        if (platformDispVal) {
+            PUTPROP(props, baseKey, platformDispVal);
+            baseVal = platformDispVal;
         }
 
         /* user.xxx.display property */
@@ -402,16 +394,6 @@
 
     ret = JVM_InitProperties(env, props);
 
-    /* Check the compatibility flag */
-    GETPROP(props, "sun.locale.formatasdefault", jVMVal);
-    if (jVMVal) {
-        const char * val = (*env)->GetStringUTFChars(env, jVMVal, 0);
-        CHECK_NULL_RETURN(val, NULL);
-        fmtdefault = !strcmp(val, "true");
-        (*env)->ReleaseStringUTFChars(env, jVMVal, val);
-        (*env)->DeleteLocalRef(env, jVMVal);
-    }
-
     /* reconstruct i18n related properties */
     fillI18nProps(env, props, "user.language", sprops->display_language,
         sprops->format_language, putID, getPropID);
@@ -430,11 +412,7 @@
          */
         PUTPROP(props, "file.encoding", sprops->encoding);
 #else
-        if (fmtdefault) {
-            PUTPROP(props, "file.encoding", sprops->encoding);
-        } else {
-            PUTPROP(props, "file.encoding", sprops->sun_jnu_encoding);
-        }
+        PUTPROP(props, "file.encoding", sprops->sun_jnu_encoding);
 #endif
     } else {
         (*env)->DeleteLocalRef(env, jVMVal);