On Tue, 4 Feb 2025 19:16:10 GMT, Chen Liang <li...@openjdk.org> wrote:
>> Adds a new `-ignoreSince` flag to the SinceChecker, mainly to help long >> running projects that are not sure about `@since` version of an API. >> The value of `@since` in `@since <ignoredString>` will be the release >> version, as I assume that this is a new API in a different OpenJDK project. >> This flag is not meant to be used in the JDK. >> >> I also improved error message when the actual `@since` value doesn’t match >> expectations. It used to say `@since version 9; should be <number>` but it >> now explains the error more clearly. > > test/jdk/tools/sincechecker/SinceChecker.java line 480: > >> 478: private Version extractSinceVersionFromText(String documentation) { >> 479: for (String ignoreSince : IGNORE_SINCE) { >> 480: if (documentation.contains(ignoreSince)) { > > Would it be more efficient to move this equality check into the > `matcher.find()` check, so we don't scan the whole document multiple times > unless we find a `@since` by the pattern first? Thanks for the feedback, fixed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/23447#discussion_r1942993267