diff options
author | Tom Tromey <tromey@redhat.com> | 2001-12-13 04:19:36 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2001-12-13 04:19:36 +0000 |
commit | 4e41d148930a3cc48effa0090c00bc2028703b58 (patch) | |
tree | 5d2e8109a7eacc506074369d1f9dc3a8535b6b82 /libjava/prims.cc | |
parent | a0de9d202503e7931ecb6f9fe068596f8631ff6b (diff) | |
download | gcc-4e41d148930a3cc48effa0090c00bc2028703b58.zip gcc-4e41d148930a3cc48effa0090c00bc2028703b58.tar.gz gcc-4e41d148930a3cc48effa0090c00bc2028703b58.tar.bz2 |
prims.cc (_Jv_RunMain): Use `using' to simplify code.
* prims.cc (_Jv_RunMain): Use `using' to simplify code. Set
_Jv_Jar_Class_Path early.
From-SVN: r47965
Diffstat (limited to 'libjava/prims.cc')
-rw-r--r-- | libjava/prims.cc | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/libjava/prims.cc b/libjava/prims.cc index 5a4c3a6..75204b8 100644 --- a/libjava/prims.cc +++ b/libjava/prims.cc @@ -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) { |