On Fri, 28 Jun 2024 10:05:48 GMT, Alexander Zvegintsev <azveg...@openjdk.org> wrote:
>> If the SecurityException is not thrown, how does the caller of >> `getRGBPixels` knows that the result will not be correct because of the >> missing permission? (as opposed to being incorrect due to a failure) > >> If the SecurityException is not thrown, how does the caller of getRGBPixels >> knows that the result will not be correct because of the missing permission? >> (as opposed to being incorrect due to a failure) > > He won't know it. An indirect result of failure can be a black image. > The [current > documentation](https://github.com/openjdk/jfx/blob/master/modules/javafx.graphics/src/main/java/javafx/scene/robot/Robot.java#L240) > documentation specifies only IllegalStateException and NullPointerException. Since `SecurityException` is deprecated, we should not throw that. In a similar situation on macOS (user has not enabled screen capture), we return a blank (all black) image, so I think that's what we would do here. ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/1490#discussion_r1658735775