[jdk11u-dev] RFR: 8306575: Clean up and open source four Dialog related tests [v2]

Andrew Lu andrewlu at openjdk.org
Thu Sep 7 09:35:41 UTC 2023


On Thu, 7 Sep 2023 08:23:15 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:

>> Andrew Lu has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   fix code
>
> test/jdk/java/awt/Dialog/DialogLocationTest.java line 105:
> 
>> 103:         for (i = 0; i < 100; i++) {
>> 104:             newX = random.nextInt(width - 300) +  insetX;
>> 105:             newY = random.nextInt(height - 400) + insetY;
> 
> Your version will get a number between insetX and insetX+width-300.
> The original change: between insetX and width-300.

fixed to
newX = random.nextInt(width - 300 - insetX) +  insetX;
newY = random.nextInt(height - 400 - insetY) + insetY;

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

PR Review Comment: https://git.openjdk.org/jdk11u-dev/pull/2088#discussion_r1318344000


More information about the jdk-updates-dev mailing list