提交 a2ba4be5 编写于 作者: K kizune

8017248: Compiler Diacritics Issue

Reviewed-by: naoto
上级 976d35af
...@@ -51,6 +51,7 @@ import java.nio.charset.Charset; ...@@ -51,6 +51,7 @@ import java.nio.charset.Charset;
import java.nio.file.DirectoryStream; import java.nio.file.DirectoryStream;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.text.Normalizer;
import java.util.ResourceBundle; import java.util.ResourceBundle;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -493,7 +494,19 @@ public enum LauncherHelper { ...@@ -493,7 +494,19 @@ public enum LauncherHelper {
try { try {
mainClass = scloader.loadClass(cn); mainClass = scloader.loadClass(cn);
} catch (NoClassDefFoundError | ClassNotFoundException cnfe) { } catch (NoClassDefFoundError | ClassNotFoundException cnfe) {
abort(cnfe, "java.launcher.cls.error1", cn); if (System.getProperty("os.name", "").contains("OS X")
&& Normalizer.isNormalized(cn, Normalizer.Form.NFD)) {
try {
// On Mac OS X since all names with diacretic symbols are given as decomposed it
// is possible that main class name comes incorrectly from the command line
// and we have to re-compose it
mainClass = scloader.loadClass(Normalizer.normalize(cn, Normalizer.Form.NFC));
} catch (NoClassDefFoundError | ClassNotFoundException cnfe1) {
abort(cnfe, "java.launcher.cls.error1", cn);
}
} else {
abort(cnfe, "java.launcher.cls.error1", cn);
}
} }
// set to mainClass // set to mainClass
appClass = mainClass; appClass = mainClass;
......
public class ClassÁ {
public static void main(String args[]) {
System.out.println("Succes!");
}
}
#!/bin/sh
# @test test.sh
# @bug 8017248
# @summary Compiler Diacritics Issue
# @run shell test.sh
OSNAME=`uname -s`
if [ "$OSNAME" == "Darwin" ]
then
rm *.class
${TESTJAVA}/bin/javac *.java
${TESTJAVA}/bin/java `echo *.class | cut -d. -f1`
else
echo Test is specific to Mac OS X, skipping.
exit 0
fi
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册