RFR: 8343802: Prevent NULL usage backsliding [v2]
Kim Barrett
kbarrett at openjdk.org
Wed Feb 5 22:47:10 UTC 2025
On Wed, 5 Feb 2025 20:12:40 GMT, Nizar Benalla <nbenalla at openjdk.org> wrote:
>> test/hotspot/jtreg/sources/TestNoNULL.java line 47:
>>
>>> 45: private static final Set<String> excludedTestFiles = new HashSet<>();
>>> 46: private static final Set<String> excludedTestExtensions = Set.of(".c", ".java", ".jar");
>>> 47: private static final Pattern NULL_PATTERN = Pattern.compile("\\bNULL\\b");
>>
>> I don't think this is the right pattern to use. See the description in JDK-8343802 for the pattern I think
>> should be used.
>
> I remember running into some false positives when using it, but I don't see them anymore so it may have been an issue on my end.
>
> Fixed in [ae3c9eb](https://github.com/openjdk/jdk/pull/23466/commits/ae3c9ebaef6fbbacdebbc1687bd41e1f3ac07df7)
Maybe this is okay. I wasn't familiar with the `\b` command, and after looking it up, it might be sufficient here.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23466#discussion_r1943777654
More information about the hotspot-dev
mailing list