On Wed, 10 May 2023 13:48:20 GMT, Alexander Zvegintsev <[email protected]>
wrote:
>> src/java.desktop/share/classes/java/awt/Robot.java line 431:
>>
>>> 429: * to capture screen content, and the required permissions are not
>>> granted,
>>> 430: * then a {@code SecurityException} may be thrown,
>>> 431: * or the content of the returned {@code Color} is undefined.
>>
>> Given that a `SecurityException` is only thrown on some platforms, is it
>> worth throwing at all? Undefined colors can still occur, so I'm not sure I
>> see much value in an exception. What do you envision that an application
>> would do with the exception?
>
> I agree, I'll try to come up with something less confusing.
If there's no exception, how does the application know the colours aren't valid
?
I think throwing the exception should be preferred behaviour and undefined
colours would be just if we had no way to detect that there was a problem.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13809#discussion_r1190311693