On Wed, 21 Jun 2023 16:12:46 GMT, Harshitha Onkar <hon...@openjdk.org> wrote:

>> test/jdk/java/awt/Frame/MaximizedToIconified/MaximizedToIconified.java line 
>> 48:
>> 
>>> 46: public class MaximizedToIconified
>>> 47: {
>>> 48:     static volatile int lastFrameState;
>> 
>> What is the purpose of test change? Can you elaborate, please?
>
> @dmarkov20 Although the test does not explicitly test the cases mentioned 
> below, it fails for the following two cases because the lastFrameState is 
> changed as we progress through the states and should be reassigned when 
> testing a new set of states. @alisenchung  is assigning this var within 
> examineStates now. Though, I would prefer to keep the initial assignment 
> as-is and have the reassignment in examineStates.
> 
>> @alisenchung
>> 
>> The current fix works for the cases listed in the test but fails for the 
>> following scenarios. To make the test more stable it is better to reassign 
>> the static variable `lastFrameState = Frame.NORMAL` in examineStates after 
>> creating a new Frame [here 
>> ](https://github.com/openjdk/jdk/blob/57b8251241e2044d5039ce162bf4637a9b2e5466/test/jdk/java/awt/Frame/MaximizedToIconified/MaximizedToIconified.java#L78),
>>  so that each time a new case is run it sets lastFrameState to default state.
>> 
>> ```
>> // CASE 1:
>> examineStates(new int[] {Frame.NORMAL, Frame.MAXIMIZED_BOTH, 
>> Frame.ICONIFIED});
>> // CASE 2:
>> examineStates(new int[] {Frame.NORMAL, Frame.ICONIFIED, 
>> Frame.MAXIMIZED_BOTH});
>> ```

Ah, I see now. I would suggest including that cases into the test.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14226#discussion_r1237543790

Reply via email to