aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryce McKinlay <mckinlay@redhat.com>2006-06-01 07:45:55 +0000
committerBryce McKinlay <bryce@gcc.gnu.org>2006-06-01 08:45:55 +0100
commit7d6d782d02ed4320a81e7e1d9caf526d583aae0a (patch)
treefc9999a1fb7eef2f890035a3561bfc6b284813d7
parentf3d5aeebf434fd8b5f500e138c12ba55aefde27b (diff)
downloadgcc-7d6d782d02ed4320a81e7e1d9caf526d583aae0a.zip
gcc-7d6d782d02ed4320a81e7e1d9caf526d583aae0a.tar.gz
gcc-7d6d782d02ed4320a81e7e1d9caf526d583aae0a.tar.bz2
prims.cc (_Jv_RunMain): Use JvNewStringUTF for command-line class name, not Latin1.
2006-05-31 Bryce McKinlay <mckinlay@redhat.com> * prims.cc (_Jv_RunMain): Use JvNewStringUTF for command-line class name, not Latin1. * gnu/java/lang/MainThread.java (run): Allow file separator char to be used in place of '.' as class-name separator. Don't chain ClassNotFoundException. From-SVN: r114300
-rw-r--r--libjava/ChangeLog8
-rw-r--r--libjava/gnu/java/lang/MainThread.java8
-rw-r--r--libjava/prims.cc2
3 files changed, 14 insertions, 4 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index c2baccf..82a9f18 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,11 @@
+2006-05-31 Bryce McKinlay <mckinlay@redhat.com>
+
+ * prims.cc (_Jv_RunMain): Use JvNewStringUTF for command-line class
+ name, not Latin1.
+ * gnu/java/lang/MainThread.java (run): Allow file separator char to
+ be used in place of '.' as class-name separator. Don't chain
+ ClassNotFoundException.
+
2006-05-31 Thomas Fitzsimmons <fitzsim@redhat.com>
* java/lang/VMClassLoader.java (initialize): Set default library
diff --git a/libjava/gnu/java/lang/MainThread.java b/libjava/gnu/java/lang/MainThread.java
index c35359f..470de0c 100644
--- a/libjava/gnu/java/lang/MainThread.java
+++ b/libjava/gnu/java/lang/MainThread.java
@@ -39,6 +39,7 @@ exception statement from your version. */
package gnu.java.lang;
+import java.io.File;
import java.util.jar.Attributes;
import java.util.jar.JarFile;
@@ -91,13 +92,14 @@ final class MainThread extends Thread
{
try
{
- klass = Class.forName(klass_name, true,
- ClassLoader.getSystemClassLoader());
+ ClassLoader cl = ClassLoader.getSystemClassLoader();
+ // Permit main class name to be specified in file-system format.
+ klass_name = klass_name.replace(File.separatorChar, '.');
+ klass = cl.loadClass(klass_name);
}
catch (ClassNotFoundException x)
{
NoClassDefFoundError ncdfe = new NoClassDefFoundError(klass_name);
- ncdfe.initCause(x);
throw ncdfe;
}
}
diff --git a/libjava/prims.cc b/libjava/prims.cc
index 1c3490e..a066866 100644
--- a/libjava/prims.cc
+++ b/libjava/prims.cc
@@ -1524,7 +1524,7 @@ _Jv_RunMain (JvVMInitArgs *vm_args, jclass klass, const char *name, int argc,
if (klass)
main_thread = new MainThread (klass, arg_vec);
else
- main_thread = new MainThread (JvNewStringLatin1 (name),
+ main_thread = new MainThread (JvNewStringUTF (name),
arg_vec, is_jar);
}
catch (java::lang::Throwable *t)