<AWT Dev>  Review request for 7117595: ArrayIndexOutOfBoundsException in Win32GraphicsEnvironment if display is removed
sergey.malenkov at oracle.com
Mon Sep 23 06:38:10 PDT 2013
> I suggest to check both bounds for the default screen index. Something
> like the following should do: max(0, min(index, screens.length - 1)).
Seems we should fix other environments too.
> Also, I assume that getScreenDevices() can't return null or an empty
> array, can it? For added safety, we might want to check this too, and
> return null in this case.
The getScreenDevices method can't return null, but it could be an empty
array. There are many places, where the getDefaultScreenDevice method
is used. Our code does not expect the null value. We could throw
HeadlessException instead. What do you think?
> best regards,
> On 09/23/13 16:47, sergey malenkov wrote:
>> Could you please review the following fix:
More information about the awt-dev