On Wed, 21 Jun 2023 08:26:12 GMT, Dmitry Markov <dmar...@openjdk.org> wrote:

>> Alisen Chung has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   updated test lastFrameState variable
>
> 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.

> @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});
> ```

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

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

Reply via email to