On Mon, 6 Jun 2022 05:29:24 GMT, Alan Bateman <al...@openjdk.org> wrote:
> One other thing you could do is link Pattern.matches in the snippet to the > matches method. Suggestion made in subsequent push; thanks. > src/java.base/share/classes/java/lang/Double.java line 683: > >> 681: * "[\\x00-\\x20]*");// Optional trailing "whitespace" >> 682: * >> 683: * if (Pattern.matches(fpRegex, myString)) // @link >> substring="Pattern.matches" target ="java.util.regex.Pattern#matches" > > If you want to avoid the annoyingly long line then you can put the "// @link > ..." on the previous line if you want. It can be done with a snippet region like this: * // @link region substring="Pattern.matches" target ="java.util.regex.Pattern#matches" * if (Pattern.matches(fpRegex, myString)) * Double.valueOf(myString); // Will not throw NumberFormatException * // @end ------------- PR: https://git.openjdk.java.net/jdk/pull/9034