On Tue, 8 Sep 2026 07:21:57 GMT, Yunbo Zhang <[email protected]> wrote:

>> Please review this small fix.
>> 
>> **Problem:**
>> 
>> `Statement.targets` is a `LinkedHashSet`, so duplicate targets in directives 
>> such as `exports p1 to m1, m2, m1;` are silently ignored. As a result, 
>> `GenModuleInfoSource` accepts invalid input instead of reporting an error.
>> 
>> **Fix:**
>> 
>> Use a local `HashSet` while parsing each directive and report an error when 
>> `add()` returns `false`.
>> 
>> **Testing:**
>> 
>> - Added tests for duplicate targets in `exports`, `opens`, and `provides`
>> - `ModuleInfoExtraTest`: passed
>> - `make test-make`: passed
>> 
>> 
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Yunbo Zhang has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   8371851: Use Statement.addTarget result to detect duplicates

@benshuai5D 
Your change (at version 16464c7682a37d60960537740153231ea0f9b31e) is now ready 
to be sponsored by a Committer.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/32698#issuecomment-5585696163

Reply via email to