RFR: 8342098: Write a test to compare the images [v3]

Abhishek Kumar abhiscxk at openjdk.org
Mon Oct 21 15:40:13 UTC 2024


On Mon, 21 Oct 2024 13:39:00 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> test/jdk/java/awt/Robot/ScreenCaptureRobotTest.java line 125:
>> 
>>> 123:                 capturedPixel = capturedImg.getRGB(i, j);
>>> 124:                 realPixel = realImg.getRGB(i, j);
>>> 125:                 if (capturedPixel != realPixel) {
>> 
>> To optimize further, `capturedImg.getRGB(i, j)` and `realImg.getRGB(i, j)` can be directly evaluated inside if condition.
>
> Yet, you'll be unable to print values unless you use `getRGB` again.

Yeah, if it is required to print values then good to save them.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21524#discussion_r1809059336


More information about the client-libs-dev mailing list