Made changes to the invalid placeholder handling in 
`ListFormat.getInstance(String[])`, stemming from 
[JDK-8385736](https://bugs.openjdk.org/browse/JDK-8385736).

This rejects duplicate placeholders and `"{2}"` outside the `three` pattern, 
with spec and test updates. Also includes minor Javadoc formatting cleanups. 
The invalid-long-pattern test added with 
[JDK-8385736](https://bugs.openjdk.org/browse/JDK-8385736) has been repurposed 
to cover the newly specified invalid-placeholder cases, because the 
repeated-placeholder input is now rejected immediately by duplicate-placeholder 
validation.

Since this changes the behavior of the method, a corresponding CSR has been 
drafted.

---------
- [x] I confirm that I make this contribution in accordance with the [OpenJDK 
Interim AI Policy](https://openjdk.org/legal/ai).

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

Commit messages:
 - initial commit

Changes: https://git.openjdk.org/jdk/pull/31377/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=31377&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8385834
  Stats: 65 lines in 2 files changed: 34 ins; 1 del; 30 mod
  Patch: https://git.openjdk.org/jdk/pull/31377.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/31377/head:pull/31377

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

Reply via email to