RFR: JDK-8287838: Update Float and Double to use snippets [v2]
Joe Darcy
darcy at openjdk.java.net
Mon Jun 6 20:55:56 UTC 2022
On Mon, 6 Jun 2022 05:29:24 GMT, Alan Bateman <alanb at 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
More information about the core-libs-dev
mailing list