On Wed, 23 Sep 2026 04:08:46 GMT, Prasanta Sadhukhan <[email protected]> 
wrote:

>> `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).
>
> Prasanta Sadhukhan has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Test update

test/jdk/javax/print/GetUIClassNameForRole.java line 44:

> 42:         for (PrintService service :
> 43:                 PrintServiceLookup.lookupPrintServices(null, null)) {
> 44:             ServiceUIFactory factory = service.getServiceUIFactory();

That should be 
if (factory != null) { ... }

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33009#discussion_r4087168025

Reply via email to