Re: RFR: JDK-8287838: Update Float and Double to use snippets [v2]

2022-06-07 Thread Alan Bateman
On Mon, 6 Jun 2022 16:54:29 GMT, Joe Darcy  wrote:

>> 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

Yes, that works. The alternative is to terminate the comment line with a colon 
(:) and that applies markup tag to the line that follows. In this case, it 
would be:

 ```
// @link substring="Pattern.matches" target ="java.util.regex.Pattern#matches" :

-

PR: https://git.openjdk.java.net/jdk/pull/9034


Re: RFR: JDK-8287838: Update Float and Double to use snippets [v2]

2022-06-06 Thread Joe Darcy
On Mon, 6 Jun 2022 05:29:24 GMT, Alan Bateman  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


Re: RFR: JDK-8287838: Update Float and Double to use snippets [v2]

2022-06-06 Thread Alan Bateman
On Mon, 6 Jun 2022 20:37:07 GMT, Joe Darcy  wrote:

>> Various code blocks in Float and Double would be better as snippets.
>
> Joe Darcy has updated the pull request incrementally with two additional 
> commits since the last revision:
> 
>  - Use idiom for shorter lines
>  - Respond to review feedback.

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.

-

PR: https://git.openjdk.java.net/jdk/pull/9034


Re: RFR: JDK-8287838: Update Float and Double to use snippets [v2]

2022-06-06 Thread Joe Darcy
> Various code blocks in Float and Double would be better as snippets.

Joe Darcy has updated the pull request incrementally with two additional 
commits since the last revision:

 - Use idiom for shorter lines
 - Respond to review feedback.

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/9034/files
  - new: https://git.openjdk.java.net/jdk/pull/9034/files/255fbb15..56abd0ac

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=9034=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=9034=00-01

  Stats: 3 lines in 1 file changed: 1 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/9034.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/9034/head:pull/9034

PR: https://git.openjdk.java.net/jdk/pull/9034


Re: RFR: JDK-8287838: Update Float and Double to use snippets

2022-06-06 Thread liach
On Sun, 5 Jun 2022 21:19:37 GMT, Joe Darcy  wrote:

> Various code blocks in Float and Double would be better as snippets.

src/java.base/share/classes/java/lang/Double.java line 643:

> 641:  * expression below can be used to screen the input string:
> 642:  *
> 643:  *  {@snippet lang="java" :

Mind remove the extra space before `{`?

-

PR: https://git.openjdk.java.net/jdk/pull/9034


Re: RFR: JDK-8287838: Update Float and Double to use snippets

2022-06-05 Thread Alan Bateman
On Sun, 5 Jun 2022 21:19:37 GMT, Joe Darcy  wrote:

> Various code blocks in Float and Double would be better as snippets.

One other thing you could do is link Pattern.matches in the snippet to the 
matches method.

-

Marked as reviewed by alanb (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/9034


RFR: JDK-8287838: Update Float and Double to use snippets

2022-06-05 Thread Joe Darcy
Various code blocks in Float and Double would be better as snippets.

-

Commit messages:
 - JDK-8287838: Update Float and Double to use snippets

Changes: https://git.openjdk.java.net/jdk/pull/9034/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk=9034=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8287838
  Stats: 6 lines in 2 files changed: 0 ins; 0 del; 6 mod
  Patch: https://git.openjdk.java.net/jdk/pull/9034.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/9034/head:pull/9034

PR: https://git.openjdk.java.net/jdk/pull/9034