harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r366522 - /incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/luni/luniglob.c
Date Fri, 06 Jan 2006 16:27:34 GMT
Author: tellison
Date: Fri Jan  6 08:27:31 2006
New Revision: 366522

URL: http://svn.apache.org/viewcvs?rev=366522&view=rev
Log:
Should not read the classpath from the properties file if it is being specific as a VM argument

Modified:
    incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/luni/luniglob.c

Modified: incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/luni/luniglob.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/luni/luniglob.c?rev=366522&r1=366521&r2=366522&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/luni/luniglob.c (original)
+++ incubator/harmony/enhanced/classlib/trunk/native-src/win.IA32/luni/luniglob.c Fri Jan
 6 08:27:31 2006
@@ -13,6 +13,13 @@
  * limitations under the License.
  */
 
+/* HarmonyDoxygen */
+/**
+ * @file
+ * @ingroup HarmonyNatives
+ * @brief Harmony LUNI natives initialization API.
+ */
+
 #include <string.h>
 #include "jcl.h"
 #include "jclglob.h"
@@ -54,6 +61,11 @@
   void *keyInitCountPtr = GLOBAL_DATA (keyInitCount);
   void **jclIdCache = GLOBAL_DATA (JCL_ID_CACHE);
   jint rcBpInit;
+  VMInterface *vmInterface;
+  JavaVMInitArgs *vmArgs;
+  JavaVMOption *currentOption;
+  int i;
+  int bootClassPathSet = 0;
 
 #if defined(LINUX)
   /* all UNIX platforms */
@@ -61,6 +73,13 @@
   HySigSet (SIGPIPE, SIG_IGN, previousGpHandler);
 #endif
 
+  /* Query the VM interface */
+  vmInterface = VMI_GetVMIFromJavaVM (vm);
+  if (!vmInterface)
+    {
+      goto fail;
+    }
+
   if ((*vm)->GetEnv (vm, (void **) &env, JNI_VERSION_1_2) == JNI_OK)
     {
       PORT_ACCESS_FROM_ENV (env);
@@ -87,12 +106,33 @@
         {
           goto fail2;
         }
-
-      /* Initialize bootstrap classpath */
-      rcBpInit = readClassPathFromPropertiesFile (vm);
-      if (JNI_OK != rcBpInit)
+      /* Grab the VM command line arguments */  
+      vmArgs = (*vmInterface)->GetInitArgs (vmInterface);
+      if (!vmArgs)
         {
-          goto fail2;
+          return JNI_ERR;
+        }
+  
+      /* Before we try to set the bootclasspath, check that it has not been specified
+         explicitly on the command line */
+      for ( i = 0; i < vmArgs->nOptions; i++ ) 
+        {
+          currentOption = &(vmArgs->options[i]);
+          if ( strstr( currentOption->optionString, "-Xbootclasspath:" ) )
+            { 
+              bootClassPathSet = 1;
+            }
+        }
+    
+      /* Only read bootsclasspath.properties if -Xbootclasspath: has not been specified */
+      if (0 == bootClassPathSet) 
+        {
+          /* Initialize bootstrap classpath */
+          rcBpInit = readClassPathFromPropertiesFile (vm);
+          if (JNI_OK != rcBpInit)
+            {
+              goto fail2;
+            }
         }
 
       return JNI_VERSION_1_2;



Mime
View raw message