From 94db4c91c30ff7cd1cfc52b9a7b5f50c1b59770e Mon Sep 17 00:00:00 2001 From: Vladimir Kozlov Date: Tue, 24 Jan 2017 17:19:01 -0800 Subject: [PATCH] 8173158: [AOT] fix typo in jaotc --help output Reviewed-by: rbackman --- .../src/jdk/tools/jaotc/Main.java | 66 +++++++++---------- hotspot/test/compiler/aot/AotCompiler.java | 2 +- .../ClasspathOptionUnknownClassTest.java | 2 +- .../aot/cli/jaotc/CompileClassTest.java | 2 +- .../cli/jaotc/ListOptionNotExistingTest.java | 2 +- .../aot/cli/jaotc/ListOptionTest.java | 2 +- .../cli/jaotc/ListOptionWrongFileTest.java | 2 +- 7 files changed, 39 insertions(+), 39 deletions(-) diff --git a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Main.java b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Main.java index 8ea8ebf81c5..a98dc8d2d81 100644 --- a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Main.java +++ b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Main.java @@ -141,6 +141,32 @@ public class Main implements LogPrinter { } task.options.outputName = name; } + }, new Option(" --class-name List of classes to compile", true, "--class-name", "--classname") { + @Override + void process(Main task, String opt, String arg) { + task.options.files.addAll(ClassSearch.makeList(ClassNameSourceProvider.TYPE, arg)); + } + }, new Option(" --jar List of jar files to compile", true, "--jar") { + @Override + void process(Main task, String opt, String arg) { + task.options.files.addAll(ClassSearch.makeList(JarSourceProvider.TYPE, arg)); + } + }, new Option(" --module List of modules to compile", true, "--module") { + @Override + void process(Main task, String opt, String arg) { + task.options.files.addAll(ClassSearch.makeList(ModuleSourceProvider.TYPE, arg)); + } + }, new Option(" --directory List of directories where to search for files to compile", true, "--directory") { + @Override + void process(Main task, String opt, String arg) { + task.options.files.addAll(ClassSearch.makeList(DirectorySourceProvider.TYPE, arg)); + } + }, new Option(" --search-path List of directories where to search for specified files", true, "--search-path") { + @Override + void process(Main task, String opt, String arg) { + String[] elements = arg.split(":"); + task.options.searchPath.add(elements); + } }, new Option(" --compile-commands Name of file with compile commands", true, "--compile-commands") { @Override void process(Main task, String opt, String arg) { @@ -151,32 +177,12 @@ public class Main implements LogPrinter { void process(Main task, String opt, String arg) { TieredAOT.setValue(true); } - }, new Option(" --compile-with-assertions Compile assertions", false, "--compile-with-assertions") { + }, new Option(" --compile-with-assertions Compile with java assertions", false, "--compile-with-assertions") { @Override void process(Main task, String opt, String arg) { task.options.compileWithAssertions = true; } - }, new Option(" --classname > Class names to AOT compile (: separated list)", true, "--classname") { - @Override - void process(Main task, String opt, String arg) { - task.options.files.addAll(ClassSearch.makeList(ClassNameSourceProvider.TYPE, arg)); - } - }, new Option(" --directory Directories to search for class files. (: separated list)", true, "--directory") { - @Override - void process(Main task, String opt, String arg) { - task.options.files.addAll(ClassSearch.makeList(DirectorySourceProvider.TYPE, arg)); - } - }, new Option(" --jar Jar files to search for class files. (: separated list)", true, "--jar") { - @Override - void process(Main task, String opt, String arg) { - task.options.files.addAll(ClassSearch.makeList(JarSourceProvider.TYPE, arg)); - } - }, new Option(" --module module names to AOT compile (: separated list)", true, "--module") { - @Override - void process(Main task, String opt, String arg) { - task.options.files.addAll(ClassSearch.makeList(ModuleSourceProvider.TYPE, arg)); - } - }, new Option(" --threads Number of compilation threads to be used", true, "--threads") { + }, new Option(" --compile-threads Number of compilation threads to be used", true, "--compile-threads", "--threads") { @Override void process(Main task, String opt, String arg) { int threads = Integer.parseInt(arg); @@ -228,12 +234,6 @@ public class Main implements LogPrinter { void process(Main task, String opt, String arg) { task.options.version = true; } - }, new Option(" --search-path Where to search for jarfiles and modules", true, "--search-path") { - @Override - void process(Main task, String opt, String arg) { - String[] elements = arg.split(":"); - task.options.searchPath.add(elements); - } }, new Option(" -J Pass directly to the runtime system", false, "-J") { @Override void process(Main task, String opt, String arg) { @@ -639,17 +639,17 @@ public class Main implements LogPrinter { } private void showUsage() { - log.println("Usage: " + PROGNAME + " list..."); + log.println("Usage: " + PROGNAME + " list"); log.println("use --help for a list of possible options"); } private void showHelp() { - log.println("Usage: " + PROGNAME + " | "); + log.println("Usage: " + PROGNAME + " list"); log.println(); - log.println(" list A list of class names, jar files or directories which"); - log.println(" contains class files."); + log.println(" list A : separated list of class names, modules, jar files"); + log.println(" or directories which contain class files."); log.println(); - log.println("where possible options include:"); + log.println("where options include:"); for (Option o : recognizedOptions) { String name = o.aliases[0].substring(1); // there must always be at least one name name = name.charAt(0) == '-' ? name.substring(1) : name; diff --git a/hotspot/test/compiler/aot/AotCompiler.java b/hotspot/test/compiler/aot/AotCompiler.java index a9e4df91195..61706277c34 100644 --- a/hotspot/test/compiler/aot/AotCompiler.java +++ b/hotspot/test/compiler/aot/AotCompiler.java @@ -100,7 +100,7 @@ public class AotCompiler { args.add("--compile-commands"); args.add(file.toString()); } - args.add("--classname"); + args.add("--class-name"); args.add(item); return launchJaotc(args, extraopts); } diff --git a/hotspot/test/compiler/aot/cli/jaotc/ClasspathOptionUnknownClassTest.java b/hotspot/test/compiler/aot/cli/jaotc/ClasspathOptionUnknownClassTest.java index 94af41f39bb..1911bc65ce3 100644 --- a/hotspot/test/compiler/aot/cli/jaotc/ClasspathOptionUnknownClassTest.java +++ b/hotspot/test/compiler/aot/cli/jaotc/ClasspathOptionUnknownClassTest.java @@ -39,7 +39,7 @@ import jdk.test.lib.process.OutputAnalyzer; public class ClasspathOptionUnknownClassTest { public static void main(String[] args) { - OutputAnalyzer oa = JaotcTestHelper.compileLibrary("--classname", "HelloWorldOne"); + OutputAnalyzer oa = JaotcTestHelper.compileLibrary("--class-name", "HelloWorldOne"); Asserts.assertNE(oa.getExitValue(), 0, "Unexpected compilation exit code"); File compiledLibrary = new File(JaotcTestHelper.DEFAULT_LIB_PATH); Asserts.assertFalse(compiledLibrary.exists(), "Compiler library unexpectedly exists"); diff --git a/hotspot/test/compiler/aot/cli/jaotc/CompileClassTest.java b/hotspot/test/compiler/aot/cli/jaotc/CompileClassTest.java index 84ffa60c31e..e12cb5026fb 100644 --- a/hotspot/test/compiler/aot/cli/jaotc/CompileClassTest.java +++ b/hotspot/test/compiler/aot/cli/jaotc/CompileClassTest.java @@ -41,7 +41,7 @@ import jdk.test.lib.process.OutputAnalyzer; public class CompileClassTest { public static void main(String[] args) { - OutputAnalyzer oa = JaotcTestHelper.compileLibrary("--classname", JaotcTestHelper + OutputAnalyzer oa = JaotcTestHelper.compileLibrary("--class-name", JaotcTestHelper .getClassAotCompilationName(HelloWorldOne.class)); oa.shouldHaveExitValue(0); File compiledLibrary = new File(JaotcTestHelper.DEFAULT_LIB_PATH); diff --git a/hotspot/test/compiler/aot/cli/jaotc/ListOptionNotExistingTest.java b/hotspot/test/compiler/aot/cli/jaotc/ListOptionNotExistingTest.java index 9d3b6af5d22..25e5e9875f2 100644 --- a/hotspot/test/compiler/aot/cli/jaotc/ListOptionNotExistingTest.java +++ b/hotspot/test/compiler/aot/cli/jaotc/ListOptionNotExistingTest.java @@ -45,7 +45,7 @@ public class ListOptionNotExistingTest { public static void main(String[] args) { OutputAnalyzer oa = JaotcTestHelper.compileLibrary("--compile-commands", "./notExisting.list", - "--classname", COMPILE_ITEM); + "--class-name", COMPILE_ITEM); int exitCode = oa.getExitValue(); Asserts.assertNE(exitCode, 0, "Unexpected compilation exit code"); File compiledLibrary = new File(JaotcTestHelper.DEFAULT_LIB_PATH); diff --git a/hotspot/test/compiler/aot/cli/jaotc/ListOptionTest.java b/hotspot/test/compiler/aot/cli/jaotc/ListOptionTest.java index 9de50bfe649..0d914dc2f7e 100644 --- a/hotspot/test/compiler/aot/cli/jaotc/ListOptionTest.java +++ b/hotspot/test/compiler/aot/cli/jaotc/ListOptionTest.java @@ -66,7 +66,7 @@ public class ListOptionTest { throw new Error("TESTBUG: can't write list file " + e, e); } OutputAnalyzer oa = JaotcTestHelper.compileLibrary("--compile-commands", COMPILE_COMMAND_FILE.toString(), - "--classname", JaotcTestHelper.getClassAotCompilationName(HelloWorldOne.class)); + "--class-name", JaotcTestHelper.getClassAotCompilationName(HelloWorldOne.class)); oa.shouldHaveExitValue(0); File compiledLibrary = new File(JaotcTestHelper.DEFAULT_LIB_PATH); Asserts.assertTrue(compiledLibrary.exists(), "Compiled library file missing"); diff --git a/hotspot/test/compiler/aot/cli/jaotc/ListOptionWrongFileTest.java b/hotspot/test/compiler/aot/cli/jaotc/ListOptionWrongFileTest.java index 0f3fd1260fb..e265a8d4389 100644 --- a/hotspot/test/compiler/aot/cli/jaotc/ListOptionWrongFileTest.java +++ b/hotspot/test/compiler/aot/cli/jaotc/ListOptionWrongFileTest.java @@ -54,7 +54,7 @@ public class ListOptionWrongFileTest { public static void main(String[] args) { // expecting wrong file to be read but no compilation directive recognized, so, all compiled - OutputAnalyzer oa = JaotcTestHelper.compileLibrary("--compile-commands", COMPILE_FILE, "--classname", COMPILE_ITEM); + OutputAnalyzer oa = JaotcTestHelper.compileLibrary("--compile-commands", COMPILE_FILE, "--class-name", COMPILE_ITEM); oa.shouldHaveExitValue(0); File compiledLibrary = new File(JaotcTestHelper.DEFAULT_LIB_PATH); Asserts.assertTrue(compiledLibrary.exists(), "Expected compiler library to exist");