diff -r 552f4bb7014e src/java.corba/share/classes/com/sun/corba/se/impl/activation/ORBD.java --- a/src/java.corba/share/classes/com/sun/corba/se/impl/activation/ORBD.java Tue Oct 10 14:39:45 2017 +0200 +++ b/src/java.corba/share/classes/com/sun/corba/se/impl/activation/ORBD.java Tue Nov 28 11:58:12 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -184,7 +184,13 @@ { Properties props = System.getProperties(); for (int i=0; i < args.length; i++) { - if (args[i].equals("-port")) { + if (args[i].equals("-?") || + args[i].equals("-h") || + args[i].equals("--help")) { + System.out.println(CorbaResourceUtil.getText( + "orbd.usage", "orbd")); + System.exit(0); + } else if (args[i].equals("-port")) { if ((i+1) < args.length) { props.put(ORBConstants.ORBD_PORT_PROPERTY, args[++i]); } else { diff -r 552f4bb7014e src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb.properties --- a/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb.properties Tue Oct 10 14:39:45 2017 +0200 +++ b/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb.properties Tue Nov 28 11:58:12 2017 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -31,6 +31,7 @@ \n -serverid Server Id for ORBD, default 1 (optional)\ \n -ORBInitialPort Initial Port (required)\ \n -ORBInitialHost Initial HostName (required)\ +\n -? -h --help Print this help message\ \n\ diff -r 552f4bb7014e src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties --- a/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties Tue Oct 10 14:39:45 2017 +0200 +++ b/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties Tue Nov 28 11:58:12 2017 +0100 @@ -43,7 +43,7 @@ \ \ \ \ -classpath : specify where to find user specified files\n\ \ \ \ \ -encoding : specify encoding to be used for annotation processing/javac invocation \n\ \ \ \ \ -episode : generate episode file for separate compilation\n\ -\ \ \ \ -disableXmlSecurity : disables XML security features for usage on xml parsing apis \n\ +\ \ \ \ -disableXmlSecurity : disables XML security features for usage on xml parsing apis \n\ \ \ \ \ -version : display version information\n\ \ \ \ \ -fullversion : display full version information\n\ -\ \ \ \ -help : display this usage message +\ \ \ \ -? -h --help : display this help message and exit diff -r 552f4bb7014e src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/SchemaGenerator.java --- a/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/SchemaGenerator.java Tue Oct 10 14:39:45 2017 +0200 +++ b/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/SchemaGenerator.java Tue Nov 28 11:58:12 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -94,14 +94,18 @@ */ public static int run(String[] args, ClassLoader classLoader) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { final Options options = new Options(); - if (args.length ==0) { + if (args.length == 0) { usage(); return -1; } for (String arg : args) { - if (arg.equals("-help")) { + if (arg.equals("-?") || + arg.equals("-h") || + arg.equals("--help") || + // -help: legacy. Undocumented. + arg.equals("-help")) { usage(); - return -1; + return 0; } if (arg.equals("-version")) { diff -r 552f4bb7014e src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/Driver.java --- a/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/Driver.java Tue Oct 10 14:39:45 2017 +0200 +++ b/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/Driver.java Tue Nov 28 11:58:12 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -505,9 +505,13 @@ throw new BadCommandLineException( Messages.format(Messages.UNRECOGNIZED_MODE, args[i])); } - if (args[i].equals("-help")) { + if (args[i].equals("-?") || + args[i].equals("-h") || + args[i].equals("--help") || + // -help: legacy. Undocumented. + args[i].equals("-help")) { usage(this,false); - throw new WeAreDone(); + System.exit(0); } if (args[i].equals("-private")) { usage(this,true); diff -r 552f4bb7014e src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties --- a/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties Tue Oct 10 14:39:45 2017 +0200 +++ b/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties Tue Nov 28 11:58:12 2017 +0100 @@ -79,7 +79,7 @@ \ \ -wsdl : treat input as WSDL and compile schemas inside it (experimental,unsupported)\n\ \ \ -verbose : be extra verbose\n\ \ \ -quiet : suppress compiler output\n\ -\ \ -help : display this help message\n\ +\ \ -? -h --help : display this help message and exit\n\ \ \ -version : display version information\n\ \ \ -fullversion : display full version information\n\ diff -r 552f4bb7014e src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/resources/WscompileMessages.java --- a/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/resources/WscompileMessages.java Tue Oct 10 14:39:45 2017 +0200 +++ b/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/resources/WscompileMessages.java Tue Nov 28 11:58:12 2017 +0100 @@ -91,7 +91,7 @@ * by the specification. Use of extensions may * result in applications that are not portable or * may not interoperate with other implementations - * -help display help + * -? -h --help display this help message * -httpproxy: set a HTTP proxy. Format is [user[:password]@]proxyHost:proxyPort * (port defaults to 8080) * -J pass this option to javac @@ -262,7 +262,7 @@ /** * Usage: {0} [options] * - * Use "wsgen -help" for a detailed description of options. + * Use "wsgen --help" for a detailed description of options. * */ public static String WSGEN_USAGE(Object arg0) { @@ -556,7 +556,7 @@ * by the specification. Use of extensions may * result in applications that are not portable or * may not interoperate with other implementations - * -help display help + * -? -h --help display this help message * -J pass this option to javac * -keep keep generated files * -r resource destination directory, specify where to @@ -591,7 +591,7 @@ /** * Usage: {0} [options] * - * Use "wsimport -help" for a detailed description of options. + * Use "wsimport --help" for a detailed description of options. * */ public static String WSIMPORT_USAGE(Object arg0) { diff -r 552f4bb7014e src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/resources/wscompile.properties --- a/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/resources/wscompile.properties Tue Oct 10 14:39:45 2017 +0200 +++ b/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/resources/wscompile.properties Tue Nov 28 11:58:12 2017 +0100 @@ -24,7 +24,7 @@ # wsimport.usage=Usage: {0} [options] \n\n\ -Use "wsimport -help" for a detailed description of options. +Use "wsimport --help" for a detailed description of options. wsimport.help=\nUsage: {0} [options] \n\n\ \where [options] include:\n\ @@ -41,7 +41,7 @@ \ by the specification. Use of extensions may\n\ \ result in applications that are not portable or\n\ \ may not interoperate with other implementations\n\ -\ -help display help\n\ +\ -? -h --help display this help message\n\ \ -httpproxy: set a HTTP proxy. Format is [user[:password]@]proxyHost:proxyPort\n\ \ (port defaults to 8080)\n\ \ -J pass this option to javac\n\ @@ -91,7 +91,7 @@ wsimport.fullversion=wsimport full version \"{0}\" wsgen.usage=Usage: {0} [options] \n\n\ -Use "wsgen -help" for a detailed description of options. +Use "wsgen --help" for a detailed description of options. wsgen.help=\nUsage: {0} [options] \n\n\ \where [options] include:\n\ @@ -103,7 +103,7 @@ \ by the specification. Use of extensions may\n\ \ result in applications that are not portable or\n\ \ may not interoperate with other implementations\n\ -\ -help display help\n\ +\ -? -h --help display this help message\n\ \ -J pass this option to javac\n\ \ -keep keep generated files\n\ \ -r resource destination directory, specify where to\n\ diff -r 552f4bb7014e src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/Options.java --- a/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/Options.java Tue Oct 10 14:39:45 2017 +0200 +++ b/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/Options.java Tue Nov 28 11:58:12 2017 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -346,7 +346,11 @@ } else if (args[i].equals("-extension")) { compatibilityMode = EXTENSION; return 1; - } else if (args[i].startsWith("-help")) { + } else if (args[i].startsWith("-?") || + args[i].startsWith("-h") || + args[i].startsWith("--help") || + // -help: legacy. Undocumented. + args[i].startsWith("-help")) { WeAreDone done = new WeAreDone(); done.initOptions(this); throw done; diff -r 552f4bb7014e test/jdk/tools/launcher/HelpFlagsTest.java --- a/test/jdk/tools/launcher/HelpFlagsTest.java Tue Oct 10 14:39:45 2017 +0200 +++ b/test/jdk/tools/launcher/HelpFlagsTest.java Tue Nov 28 11:58:12 2017 +0100 @@ -59,15 +59,6 @@ "jconsole", // gui, don't test "servertool", // none. Shell, don't test. "javaw", // don't test, win only - // The flags of these tools need to be fixed in Java EE. - // The tools are deprecated for removal in Java SE. Don't test. - "idlj", - "orbd", - "schemagen", - "tnameserv", - "wsgen", - "wsimport", - "xjc", // These shall have a help message that resembles that of // MIT's tools. Thus -?, -h and --help are supported, but not // mentioned in the help text. @@ -135,6 +126,7 @@ // name -? -h --help exitcode -help -help exitcode Don't // of help docu of wrong test // mented flag inv flag + new ToolHelpSpec("idlj", 0, 0, 0, 0, 0, 0, 0, 0), // none, prints help message anyways. new ToolHelpSpec("jabswitch", 0, 0, 0, 0, 0, 0, 0, 0), // /?, prints help message anyways, win only new ToolHelpSpec("jaotc", 1, 1, 1, 0, 0, 0, 2, 0), // -?, -h, --help new ToolHelpSpec("jar", 1, 1, 1, 0, 0, 0, 1, 0), // -?, -h, --help @@ -163,12 +155,18 @@ new ToolHelpSpec("jstat", 1, 1, 1, 0, 1, 0, 1, 0), // -?, -h, --help, -help accepted but not documented. new ToolHelpSpec("jstatd", 1, 1, 1, 0, 0, 0, 1, 0), // -?, -h, --help new ToolHelpSpec("keytool", 1, 1, 1, 0, 1, 0, 1, 0), // none, prints help message anyways. + new ToolHelpSpec("orbd", 1, 1, 1, 0, 0, 0, 0, 1), // -?, -h, --help new ToolHelpSpec("pack200", 1, 1, 1, 0, 1, 0, 2, 0), // -?, -h, --help, -help accepted but not documented. new ToolHelpSpec("rmic", 0, 0, 0, 0, 0, 0, 1, 0), // none, pirnts help message anyways. new ToolHelpSpec("rmid", 0, 0, 0, 0, 0, 0, 1, 0), // none, prints help message anyways. new ToolHelpSpec("rmiregistry", 0, 0, 0, 0, 0, 0, 1, 0), // none, prints help message anyways. + new ToolHelpSpec("schemagen", 1, 1, 1, 0, 1, 0, 255, 0), // -?, -h, --help, -help accepted but not documented. new ToolHelpSpec("serialver", 0, 0, 0, 0, 0, 0, 1, 0), // none, prints help message anyways. + new ToolHelpSpec("tnameserv", 0, 0, 0, 0, 0, 0, 0, 1), // Just starts given any flag. new ToolHelpSpec("unpack200", 1, 1, 1, 0, 1, 0, 2, 0), // -?, -h, --help, -help accepted but not documented. + new ToolHelpSpec("wsgen", 1, 1, 1, 0, 1, 0, 1, 0), // -?, -h, --help, -help accepted but not documented. + new ToolHelpSpec("wsimport", 1, 1, 1, 0, 1, 0, 1, 0), // -?, -h, --help, -help accepted but not documented. + new ToolHelpSpec("xjc", 1, 1, 1, 0, 1, 0, 255, 0) // -?, -h, --help, -help accepted but not documented. }; // Returns true if tool is listed in TOOLS_NOT_TO_TEST.