On Fri, 20 Jan 2023 17:57:47 GMT, Justin Lu <j...@openjdk.org> wrote:
>> Some classes / interfaces in java.text have already implemented JEP 413. >> >> This PR implements _JEP 413: Code Snippets in Java API Documentation_ for >> the rest of >> [java.text](https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/text/package-summary.html) >> including: >> - BreakIterator >> - CharacterIterator >> - DateFormatSymbols >> - DecimalFormat >> - NumberFormat >> >> Code examples using <pre> ... </pre> blocks are replaced with the @ snippet >> syntax where applicable. > > src/java.base/share/classes/java/text/DecimalFormat.java line 343: > >> 341: * <blockquote><pre><strong>{@code >> 342: * // Print out a number using the localized number, integer, currency, >> 343: * // and percent format for each locale}</strong>{@code > > This comment is originally in strong font within the code example. Replacing > both instances of `@ code` with `@ snippet` will just create two separate > snippet blocks, one for the comment and one for the code which does not seem > ideal. > > To maintain the strong font, the comment has to be outside of the code > snippet. > > If that's not desirable, I think some alternatives are > > - Leave the comment in the code snippet and get rid of the strong font > - Keep the strong font but convert the comment into a normal text description I would leave the comment in the code snippet. I don't see a compelling reason for it to be as it was originally ------------- PR: https://git.openjdk.org/jdk/pull/12121