[Rev 01] RFR: 402: Properly parse issue titles starting with non-alphanumeric characters
Robin Westberg
rwestberg at openjdk.java.net
Tue May 26 04:49:08 UTC 2020
On Mon, 25 May 2020 13:42:48 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
>> Robin Westberg has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Update vcs/src/main/java/org/openjdk/skara/vcs/openjdk/Issue.java
>>
>> Co-authored-by: Jorn Vernee <JornVernee at users.noreply.github.com>
>
> vcs/src/main/java/org/openjdk/skara/vcs/openjdk/Issue.java line 33:
>
>> 32:
>> 33: private final static Pattern relaxedIssueParsePattern =
>> Pattern.compile("^((?:[A-Z][A-Z0-9]+-)?[0-9]+)(?:(?:[^\\p{Alnum}]+\\s)|(?:\\s+))(\\S.*)$"); 34:
>
> I think the `[^\\p{Alnum}]+\\s` pattern mostly subsumes the `\\s+` pattern? I think it can be simplified to:
> Suggestion:
>
> private final static Pattern relaxedIssueParsePattern =
> Pattern.compile("^((?:[A-Z][A-Z0-9]+-)?[0-9]+)[^\\p{Alnum}]*\\s(\\S.*)$");
> This passes the test locally.
Thanks, that certainly is nicer!
-------------
PR: https://git.openjdk.java.net/skara/pull/628
More information about the skara-dev
mailing list