RFR: 8224261: JProgressBar always with border painted around it [v2]

Abhishek Kumar abhiscxk at openjdk.org
Fri Nov 17 15:00:54 UTC 2023


On Thu, 16 Nov 2023 13:13:05 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Review comment fix
>
> test/jdk/javax/swing/JProgressBar/TestProgressBarBorder.java line 145:
> 
>> 143:     */
>> 144: 
>> 145:     private static boolean compareImage(BufferedImage img1, BufferedImage img2) {
> 
> You can use the method from `regtesthelpers/Util`:
> 
> https://github.com/openjdk/jdk/blob/9faead1469481e268b451f2853c8fec8613426b9/test/jdk/javax/swing/regtesthelpers/Util.java#L59-L80
> 
> If you don't want to use, I suggest reversing the conditions so that `compareImage` returns `true` when images are the same — it's more common and therefore less confusing. In addition to that, return quickly if the sizes are different (can they ever be?) and avoid nesting the `for`-loops inside the `if` statement.

Updated the test to use the method from regtesthelpers/Util.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16467#discussion_r1397440923


More information about the client-libs-dev mailing list