OSDN Git Service

* prims.cc (_Jv_RunMain): Use `using' to simplify code. Set
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 13 Dec 2001 04:19:36 +0000 (04:19 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 13 Dec 2001 04:19:36 +0000 (04:19 +0000)
_Jv_Jar_Class_Path early.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47965 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/prims.cc

index d41ff8d..4116fae 100644 (file)
@@ -1,5 +1,8 @@
 2001-12-12  Tom Tromey  <tromey@redhat.com>
 
+       * prims.cc (_Jv_RunMain): Use `using' to simplify code.  Set
+       _Jv_Jar_Class_Path early.
+
        * jni.cc (call): Synchronize if required.
 
        * gij.cc (main): Clarify --help output.
index 5a4c3a6..75204b8 100644 (file)
@@ -994,6 +994,10 @@ _Jv_RunMain (jclass klass, const char *name, int argc, const char **argv,
 
   try
     {
+      // Set this very early so that it is seen when java.lang.System
+      // is initialized.
+      if (is_jar)
+       _Jv_Jar_Class_Path = strdup (name);
       _Jv_CreateJavaVM (NULL);
 
       // Get the Runtime here.  We want to initialize it before searching
@@ -1002,20 +1006,12 @@ _Jv_RunMain (jclass klass, const char *name, int argc, const char **argv,
 
       arg_vec = JvConvertArgv (argc - 1, argv + 1);
 
+      using namespace gnu::gcj::runtime;
       if (klass)
-       main_thread = new gnu::gcj::runtime::FirstThread (klass, arg_vec);
+       main_thread = new FirstThread (klass, arg_vec);
       else
-       main_thread = new gnu::gcj::runtime::FirstThread 
-                       (JvNewStringLatin1 (name), arg_vec, is_jar);
-
-      if (is_jar)
-       {
-         // We need a new ClassLoader because the classpath must be the
-         // jar file only.  The easiest way to do this is to lose our
-         // reference to the previous classloader.
-         _Jv_Jar_Class_Path = strdup (name);
-         gnu::gcj::runtime::VMClassLoader::instance = NULL;
-       }
+       main_thread = new FirstThread (JvNewStringLatin1 (name),
+                                      arg_vec, is_jar);
     }
   catch (java::lang::Throwable *t)
     {