Re: RFR: JDK-8298405: Support Markdown in Documentation Comments [v26]

2024-02-08 Thread Jonathan Gibbons
On Thu, 8 Feb 2024 20:58:24 GMT, Jonathan Gibbons  wrote:

>> Ping.
>
> I believe this is substantially covered in line 226-227.  See the third call 
> to `test` in the following group of lines:
> 
> 
> for (String src : sources) {
> test(src);
> test(src.replaceAll("@Deprecated", "/** @deprecated */"));
> test(src.replaceAll("deprecated", "notDeprecated2") // change 
> class name
> .replaceAll("@Deprecated", "/// @deprecated\n"));
> }
> 
> 
> * The first call, `test(src)`, runs all the test cases, using the 
> `@Deprecated` annotation by default.  In these test cases, the name of the 
> element encodes whether it is expected that the element is deprecated or not.
> 
> * The second call, `test(src.replaceAll("deprecated", "notDeprecated2")`, 
> runs the test cases again, after changing the annotation to a traditional 
> (`/** ...*/`) comment containing the `@deprecated` tag. This is a 
> long-standing call, and tests the legacy behavior of `@deprecated` appearing 
> in a traditional doc comment.  Effectively, it tests whether a `/** 
> @deprecated */` comment has equivalent behavior to a `@Deprecated` comment.
> 
> * The third call is new to this PR and the functionality to support Markdown 
> comments.  It makes two changes to the source for the test cases, before 
> running them:
>1. as in the previous test, the annotations are replaced by a comment 
> containing `@deprecated` -- except that this time, the comment is a new-style 
> `/// ... ` comment instead of a traditional `/** ... */` comment, and ...
>2. because we do not expect `/// @deprecated` to indicate deprecation, we 
> need to change the expected result for each test case, which we do by 
> changing the element name for the test case.  The change is the first call to 
> replace to avoid false positives after changing the doc comment. The change 
> uses a new name, `notDeprecated2`, in which `notDeprecated` encodes the 
> expected deprecation status, and the `2` is to differentiate the declarations 
> from other declarations in the case case that already use the name 
> `notDeprecated`.

While the underlying mechanism in javac for indicating deprecation is the same 
for all, I accept this is primarily a test for generated class files. I can add 
a javadoc test for basic behavior of `@deprecated` in Markdown comments.

-

PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1483628179


Re: RFR: JDK-8298405: Support Markdown in Documentation Comments [v26]

2024-02-08 Thread Jonathan Gibbons
> Please review a patch to add support for Markdown syntax in documentation 
> comments, as described in the associated JEP.
> 
> Notable features:
> 
> * support for `///` documentation comments in `JavaTokenizer`
> * new module `jdk.internal.md` -- a private copy of the `commonmark-java` 
> library
> * updates to `DocCommentParser` to treat `///` comments as Markdown
> * updates to the standard doclet to render Markdown comments in HTML

Jonathan Gibbons has updated the pull request incrementally with one additional 
commit since the last revision:

  amend comment in test

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/16388/files
  - new: https://git.openjdk.org/jdk/pull/16388/files/c891fe9a..cb070451

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=16388&range=25
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16388&range=24-25

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/16388.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16388/head:pull/16388

PR: https://git.openjdk.org/jdk/pull/16388