> 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

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/32698/files
  - new: https://git.openjdk.org/jdk/pull/32698/files/e1f8c4dd..16464c76

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=32698&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=32698&range=00-01

  Stats: 7 lines in 1 file changed: 0 ins; 4 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/32698.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/32698/head:pull/32698

PR: https://git.openjdk.org/jdk/pull/32698

Reply via email to