RFR: 8376325: [IR Framework] Detect and report overloads [v2]
Marc Chevalier
mchevalier at openjdk.org
Fri Jan 30 12:49:24 UTC 2026
On Fri, 30 Jan 2026 11:03:00 GMT, Damon Fenacci <dfenacci at openjdk.org> wrote:
>> Marc Chevalier has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Copyright
>
> test/hotspot/jtreg/compiler/lib/ir_framework/test/TestVM.java line 597:
>
>> 595: );
>> 596: TestFormat.check(!testMethodMap.containsKey(m.getName()),
>> 597: "Cannot overload two @Test methods: " + m + ", " + testMethodMap.get(m.getName()));
>
> Is this check redundant now? Or maybe we could exclude it from the first check if we want to keep the more precise message?
It should be redundant. I considered removing it, but it is checking its property very differently: by checking `testMethodMap` doesn't have this key yet, which is nice since we are about to insert something at the said key. I preferred to keep it more as an assert: I expect the first check to fire, but if this one does, it likely means that either the first check is wrong, or we are not filling `testMethodMap` correctly. I'm ok removing it, but I would rather not put it first because I fear it might be confusing to see first "you can't overload a test method with a test method", and then "you can't overload a test method at all" (I'd be thinking "well, tell me that in the first place then!"). But not strong strong opinion. What about @chhagedorn?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29483#discussion_r2746115946
More information about the hotspot-compiler-dev
mailing list