RFR: 8343802: Prevent NULL usage backsliding [v2]
Nizar Benalla
nbenalla at openjdk.org
Fri Feb 7 13:11:27 UTC 2025
On Thu, 6 Feb 2025 21:41:14 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
>> Nizar Benalla has updated the pull request incrementally with one additional commit since the last revision:
>>
>> update based on feedback
>
> test/hotspot/jtreg/sources/TestNoNULL.java line 46:
>
>> 44: private static final Set<String> excludedTestFiles = new HashSet<>();
>> 45: private static final Set<String> excludedTestExtensions = Set.of(".c", ".java", ".jar");
>> 46: private static final Pattern NULL_PATTERN = Pattern.compile("(?<![\\p{Alnum}_])NULL(?![\\p{Alnum}_])");
>
> I'm not a regex expert, but I think the earlier version using `\b` should be okay. And it's a
> _lot_ clearer than this version, now that I actually know what `\b` means. Sorry for leading
> you astray.
No problem, I spent some time running additional tests to see if `\b` is enough for our use case.
Updated in [3b8b05d](https://github.com/openjdk/jdk/pull/23466/commits/3b8b05d15c747370a51e35265292a16115e88b5e).
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23466#discussion_r1946501429
More information about the hotspot-dev
mailing list