changeset 1557:60caf53b98e2

8007610: javadoc doclint does not work with -private Reviewed-by: darcy
author jjg
date Fri, 08 Feb 2013 17:35:16 -0800
parents 017e8bdd440f
children 01af1b5c631d
files src/share/classes/com/sun/tools/javadoc/DocEnv.java test/com/sun/javadoc/T6735320/T6735320.java test/tools/javadoc/doclint/DocLintTest.java
diffstat 3 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/javadoc/DocEnv.java	Fri Feb 08 09:21:19 2013 +0000
+++ b/src/share/classes/com/sun/tools/javadoc/DocEnv.java	Fri Feb 08 17:35:16 2013 -0800
@@ -801,7 +801,9 @@
             doclintOpts.add(opt == null ? DocLint.XMSGS_OPTION : DocLint.XMSGS_CUSTOM_PREFIX + opt);
         }
 
-        if (doclintOpts.size() == 1
+        if (doclintOpts.isEmpty()) {
+            doclintOpts.add(DocLint.XMSGS_OPTION);
+        } else if (doclintOpts.size() == 1
                 && doclintOpts.get(0).equals(DocLint.XMSGS_CUSTOM_PREFIX + "none")) {
             return;
         }
--- a/test/com/sun/javadoc/T6735320/T6735320.java	Fri Feb 08 09:21:19 2013 +0000
+++ b/test/com/sun/javadoc/T6735320/T6735320.java	Fri Feb 08 17:35:16 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -47,8 +47,8 @@
 
     public static void main(String... args) {
         T6735320 tester = new T6735320();
-        if (tester.runJavadoc(ARGS) != 0) {
-            throw new AssertionError("non-zero return code from javadoc");
+        if (tester.runJavadoc(ARGS) == 0) {
+            throw new AssertionError("zero return code from javadoc");
         }
         if (tester.getErrorOutput().contains("StringIndexOutOfBoundsException")) {
             throw new AssertionError("javadoc threw StringIndexOutOfBoundsException");
--- a/test/tools/javadoc/doclint/DocLintTest.java	Fri Feb 08 09:21:19 2013 +0000
+++ b/test/tools/javadoc/doclint/DocLintTest.java	Fri Feb 08 17:35:16 2013 -0800
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8004834
+ * @bug 8004834 8007610
  * @summary Add doclint support into javadoc
  */
 
@@ -157,6 +157,10 @@
                 Main.Result.OK,
                 EnumSet.of(Message.DL_WRN12));
 
+        test(Arrays.asList(rawDiags, "-private"),
+                Main.Result.ERROR,
+                EnumSet.of(Message.DL_ERR6, Message.DL_ERR9, Message.DL_WRN12));
+
         test(Arrays.asList(rawDiags, "-Xdoclint:syntax", "-private"),
                 Main.Result.ERROR,
                 EnumSet.of(Message.DL_ERR6, Message.DL_WRN12));