8031212: doclint incorrectly rejects some @see tags in javadoc comments
authorjjg
Mon, 27 Jan 2014 16:07:32 -0800 (2014-01-28)
changeset 22692 51651a2a3443
parent 22691 ea96f68e3d9a
child 22693 d9f55dfc5f3b
8031212: doclint incorrectly rejects some @see tags in javadoc comments Reviewed-by: vromero
langtools/src/share/classes/com/sun/tools/javac/parser/DocCommentParser.java
langtools/test/tools/javac/doctree/SeeTest.java
--- a/langtools/src/share/classes/com/sun/tools/javac/parser/DocCommentParser.java	Fri Jan 24 08:47:32 2014 -0500
+++ b/langtools/src/share/classes/com/sun/tools/javac/parser/DocCommentParser.java	Mon Jan 27 16:07:32 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, 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
@@ -1173,8 +1173,10 @@
                             DCText string = quotedString();
                             if (string != null) {
                                 skipWhitespace();
-                                if (ch == '@')
+                                if (ch == '@'
+                                        || ch == EOI && bp == buf.length - 1) {
                                     return m.at(pos).See(List.<DCTree>of(string));
+                                }
                             }
                             break;
 
--- a/langtools/test/tools/javac/doctree/SeeTest.java	Fri Jan 24 08:47:32 2014 -0500
+++ b/langtools/test/tools/javac/doctree/SeeTest.java	Mon Jan 27 16:07:32 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, 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
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 7021614
+ * @bug 7021614 8031212
  * @summary extend com.sun.source API to support parsing javadoc comments
  * @build DocCommentTester
  * @run main DocCommentTester SeeTest.java
@@ -41,9 +41,9 @@
     Text[TEXT, pos:1, abc.]
   body: empty
   block tags: 1
-    Erroneous[ERRONEOUS, pos:7
-      code: compiler.err.dc.unexpected.content
-      body: @see_"String"
+    See[SEE, pos:7
+      reference: 1
+        Text[TEXT, pos:12, "String"]
     ]
 ]
 */