8009924: some langtools tools do not accept -cp as an alias for -classpath
authorvromero
Thu, 04 Jul 2013 10:35:33 +0100
changeset 18898 0eab5f5e3d1d
parent 18672 1d6d1be0a94f
child 18899 2557b27d1f1c
8009924: some langtools tools do not accept -cp as an alias for -classpath Reviewed-by: jjg
langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java
langtools/src/share/classes/com/sun/tools/doclint/DocLint.java
langtools/src/share/classes/com/sun/tools/doclint/resources/doclint.properties
langtools/src/share/classes/com/sun/tools/javadoc/ToolOption.java
langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc.properties
langtools/src/share/classes/com/sun/tools/javah/JavahTask.java
langtools/src/share/classes/com/sun/tools/javah/resources/l10n.properties
langtools/src/share/classes/com/sun/tools/javap/JavapTask.java
langtools/src/share/classes/com/sun/tools/javap/resources/javap.properties
langtools/test/tools/doclint/tool/HelpTest.out
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java	Tue Jul 02 22:49:40 2013 +0100
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java	Thu Jul 04 10:35:33 2013 +0100
@@ -467,7 +467,7 @@
                 nodeprecated = true;
             } else if (opt.equals("-sourcepath")) {
                 sourcepath = os[1];
-            } else if (opt.equals("-classpath") &&
+            } else if ((opt.equals("-classpath") || opt.equals("-cp")) &&
                        sourcepath.length() == 0) {
                 sourcepath = os[1];
             } else if (opt.equals("-excludedocfilessubdir")) {
--- a/langtools/src/share/classes/com/sun/tools/doclint/DocLint.java	Tue Jul 02 22:49:40 2013 +0100
+++ b/langtools/src/share/classes/com/sun/tools/doclint/DocLint.java	Thu Jul 04 10:35:33 2013 +0100
@@ -187,6 +187,8 @@
                 javacBootClassPath = splitPath(args[++i]);
             } else if (arg.equals("-classpath") && i + 1 < args.length) {
                 javacClassPath = splitPath(args[++i]);
+            } else if (arg.equals("-cp") && i + 1 < args.length) {
+                javacClassPath = splitPath(args[++i]);
             } else if (arg.equals("-sourcepath") && i + 1 < args.length) {
                 javacSourcePath = splitPath(args[++i]);
             } else if (arg.equals(XMSGS_OPTION)) {
--- a/langtools/src/share/classes/com/sun/tools/doclint/resources/doclint.properties	Tue Jul 02 22:49:40 2013 +0100
+++ b/langtools/src/share/classes/com/sun/tools/doclint/resources/doclint.properties	Thu Jul 04 10:35:33 2013 +0100
@@ -109,7 +109,7 @@
 \    Show this message.\n\
 \n\
 The following javac options are also supported\n\
-\  -bootclasspath, -classpath, -sourcepath, -Xmaxerrs, -Xmaxwarns\n\
+\  -bootclasspath, -classpath, -cp, -sourcepath, -Xmaxerrs, -Xmaxwarns\n\
 \n\
 To run doclint on part of a project, put the compiled classes for your\n\
 project on the classpath (or bootclasspath), then specify the source files\n\
--- a/langtools/src/share/classes/com/sun/tools/javadoc/ToolOption.java	Tue Jul 02 22:49:40 2013 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/ToolOption.java	Thu Jul 04 10:35:33 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2013, 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
@@ -56,6 +56,13 @@
         }
     },
 
+    CP("-cp", true) {
+        @Override
+        public void process(Helper helper, String arg) {
+            helper.setCompilerOpt(opt, arg);
+        }
+    },
+
     EXTDIRS("-extdirs", true) {
         @Override
         public void process(Helper helper, String arg) {
--- a/langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc.properties	Tue Jul 02 22:49:40 2013 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc.properties	Thu Jul 04 10:35:33 2013 +0100
@@ -39,6 +39,7 @@
 \  -docletpath <path>               Specify where to find doclet class files\n\
 \  -sourcepath <pathlist>           Specify where to find source files\n\
 \  -classpath <pathlist>            Specify where to find user class files\n\
+\  -cp <pathlist>                   Specify where to find user class files\n\
 \  -exclude <pkglist>               Specify a list of packages to exclude\n\
 \  -subpackages <subpkglist>        Specify subpackages to recursively load\n\
 \  -breakiterator                   Compute first sentence with BreakIterator\n\
--- a/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java	Tue Jul 02 22:49:40 2013 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java	Thu Jul 04 10:35:33 2013 +0100
@@ -531,7 +531,7 @@
             String name = o.aliases[0].substring(1); // there must always be at least one name
             log.println(getMessage("main.opt." + name));
         }
-        String[] fmOptions = { "-classpath", "-bootclasspath" };
+        String[] fmOptions = { "-classpath", "-cp", "-bootclasspath" };
         for (String o: fmOptions) {
             if (fileManager.isSupportedOption(o) == -1)
                 continue;
--- a/langtools/src/share/classes/com/sun/tools/javah/resources/l10n.properties	Tue Jul 02 22:49:40 2013 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javah/resources/l10n.properties	Thu Jul 04 10:35:33 2013 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2013, 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
@@ -77,6 +77,7 @@
 \n\t\
 -help                 Print this help message and exit\n\t\
 -classpath <path>     Path from which to load classes\n\t\
+-cp <path>            Path from which to load classes\n\t\
 -bootclasspath <path> Path from which to load bootstrap classes\n\t\
 -d <dir>              Output directory\n\t\
 -o <file>             Output file (only one of -d or -o may be used)\n\t\
@@ -108,6 +109,8 @@
 \  -force                   Always write output files
 main.opt.classpath=\
 \  -classpath <path>        Path from which to load classes
+main.opt.cp=\
+\  -cp <path>               Path from which to load classes
 main.opt.bootclasspath=\
 \  -bootclasspath <path>    Path from which to load bootstrap classes
 main.usage.foot=\
--- a/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java	Tue Jul 02 22:49:40 2013 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java	Thu Jul 04 10:35:33 2013 +0100
@@ -885,7 +885,7 @@
                 continue;
             log.println(getMessage("main.opt." + name));
         }
-        String[] fmOptions = { "-classpath", "-bootclasspath" };
+        String[] fmOptions = { "-classpath", "-cp", "-bootclasspath" };
         for (String o: fmOptions) {
             if (fileManager.isSupportedOption(o) == -1)
                 continue;
--- a/langtools/src/share/classes/com/sun/tools/javap/resources/javap.properties	Tue Jul 02 22:49:40 2013 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javap/resources/javap.properties	Thu Jul 04 10:35:33 2013 +0100
@@ -1,5 +1,5 @@
 
-err.prefix=Error: 
+err.prefix=Error:
 
 err.bad.constant.pool=error while reading constant pool for {0}: {1}
 err.class.not.found=class not found: {0}
@@ -73,6 +73,9 @@
 main.opt.classpath=\
 \  -classpath <path>        Specify where to find user class files
 
+main.opt.cp=\
+\  -cp <path>               Specify where to find user class files
+
 main.opt.bootclasspath=\
 \  -bootclasspath <path>    Override location of bootstrap class files
 
--- a/langtools/test/tools/doclint/tool/HelpTest.out	Tue Jul 02 22:49:40 2013 +0100
+++ b/langtools/test/tools/doclint/tool/HelpTest.out	Thu Jul 04 10:35:33 2013 +0100
@@ -36,7 +36,7 @@
     Show this message.
 
 The following javac options are also supported
-  -bootclasspath, -classpath, -sourcepath, -Xmaxerrs, -Xmaxwarns
+  -bootclasspath, -classpath, -cp, -sourcepath, -Xmaxerrs, -Xmaxwarns
 
 To run doclint on part of a project, put the compiled classes for your
 project on the classpath (or bootclasspath), then specify the source files