From 478d2876a5f3804107b10c6320ac68792bb2cc9d Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Mon, 27 Jan 2014 16:07:32 -0800 Subject: [PATCH] 8031212: doclint incorrectly rejects some @see tags in javadoc comments Reviewed-by: vromero --- .../com/sun/tools/javac/parser/DocCommentParser.java | 6 ++++-- langtools/test/tools/javac/doctree/SeeTest.java | 10 +++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/langtools/src/share/classes/com/sun/tools/javac/parser/DocCommentParser.java b/langtools/src/share/classes/com/sun/tools/javac/parser/DocCommentParser.java index 3a211dc8cec..2b3f11beefa 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/parser/DocCommentParser.java +++ b/langtools/src/share/classes/com/sun/tools/javac/parser/DocCommentParser.java @@ -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 @@ public class DocCommentParser { DCText string = quotedString(); if (string != null) { skipWhitespace(); - if (ch == '@') + if (ch == '@' + || ch == EOI && bp == buf.length - 1) { return m.at(pos).See(List.of(string)); + } } break; diff --git a/langtools/test/tools/javac/doctree/SeeTest.java b/langtools/test/tools/javac/doctree/SeeTest.java index bb2734814d9..6927788ce27 100644 --- a/langtools/test/tools/javac/doctree/SeeTest.java +++ b/langtools/test/tools/javac/doctree/SeeTest.java @@ -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 @@ DocComment[DOC_COMMENT, pos:1 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"] ] ] */