You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by ap...@apache.org on 2007/05/08 16:33:57 UTC

svn commit: r536204 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/luniglob.c

Author: apetrenko
Date: Tue May  8 07:33:57 2007
New Revision: 536204

URL: http://svn.apache.org/viewvc?view=rev&rev=536204
Log:
Patch for HARMONY-3736 "[classlib][luni] provide appropriate values for non-standard impl-specifc properties"

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/luniglob.c

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/luniglob.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/luniglob.c?view=diff&rev=536204&r1=536203&r2=536204
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/luniglob.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/luniglob.c Tue May  8 07:33:57 2007
@@ -52,6 +52,8 @@
   void **harmonyIdCache = GLOBAL_DATA (HARMONY_ID_CACHE);
   VMInterface *vmInterface;
   char *bootPath = NULL;
+  char *propVal = NULL;
+  vmiError propRes;
 
 #if defined(LINUX)
   /* all UNIX platforms */
@@ -129,6 +131,70 @@
                }
            }
        }
+
+       /* set other (not required by api specification) properties */
+       (*vmInterface)->GetSystemProperty (vmInterface, "user.language", &propVal);
+       if (propVal == NULL) {
+            /* FIXME provide appropriate non-dummy value */
+           propRes = (*vmInterface)->SetSystemProperty (vmInterface, "user.language", "en");
+           if (VMI_ERROR_NONE != propRes) {
+               /* goto fail2; */
+           }
+       }
+       (*vmInterface)->GetSystemProperty (vmInterface, "user.country", &propVal);
+       if (propVal == NULL) {
+           /* FIXME provide appropriate non-dummy value */
+           propRes = (*vmInterface)->SetSystemProperty (vmInterface, "user.country", "US");
+           if (VMI_ERROR_NONE != propRes) {
+               /* goto fail2; */
+           }
+       }
+
+       (*vmInterface)->GetSystemProperty (vmInterface, "user.timezone", &propVal);
+       if (propVal == NULL) {
+           /* FIXME provide appropriate non-dummy value */
+           propRes = (*vmInterface)->SetSystemProperty (vmInterface, "user.timezone", "GMT");
+           if (VMI_ERROR_NONE != propRes) {
+               /* goto fail2; */
+           }
+       }
+
+       /* Many classes depend on correct "file.encoding" value */
+       (*vmInterface)->GetSystemProperty (vmInterface, "file.encoding", &propVal);
+       if (propVal == NULL) {
+           /* FIXME provide appropriate non-dummy value */
+           propRes = (*vmInterface)->SetSystemProperty (vmInterface, "file.encoding", "8859_1");
+           if (VMI_ERROR_NONE != propRes) {
+               /* goto fail2; */
+           }
+       }
+
+       /* Set default PreferencesFactory implementation */
+       (*vmInterface)->GetSystemProperty (vmInterface, "java.util.prefs.PreferencesFactory", &propVal);
+       if (propVal == NULL) {
+           propRes = (*vmInterface)->SetSystemProperty (vmInterface, 
+               "java.util.prefs.PreferencesFactory",
+#ifdef _WIN32
+               "java.util.prefs.RegistryPreferencesFactoryImpl");
+#else
+               "java.util.prefs.FilePreferencesFactoryImpl");
+#endif
+           if (VMI_ERROR_NONE != propRes) {
+               /* goto fail2; */
+           }
+       }
+
+       /* Prefer Xalan compiler for better performance, see HARMONY-3209. */
+       (*vmInterface)->GetSystemProperty (vmInterface, "javax.xml.transform.TransformerFactory", &propVal);
+       if (propVal == NULL) {
+           propRes = (*vmInterface)->SetSystemProperty (vmInterface, 
+               "javax.xml.transform.TransformerFactory", 
+               "org.apache.xalan.xsltc.trax.TransformerFactoryImpl");
+           if (VMI_ERROR_NONE != propRes) {
+               /* goto fail2; */
+           }
+       }
+
        return JNI_VERSION_1_2;
     }