`Win32PrintService.Win32ServiceUIFactory.getUIClassNamesForRole()` incorrectly 
creates a zero-length String array when handling 
`DocumentPropertiesUI.DOCUMENTPROPERTIES_ROLE`, then writes the Document 
Properties UI class name at index zero, so as
a result, calling 
`Win32PrintService.getServiceUIFactory().getUIClassNamesForRole(DocumentPropertiesUI.DOCUMENTPROPERTIES_ROLE)`
throws `ArrayIndexOutOfBoundsException `instead of reporting the supported UI 
class.

The fix returns a single-element array containing 
`DocumentPropertiesUI.DOCPROPERTIESCLASSNAME`



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

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

Commit messages:
 - fix
 - 8392783: Win32PrintService.getUIClassNamesForRole throws 
ArrayIndexOutOfBoundsException

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

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

Reply via email to