On Wed, 30 Nov 2022 16:38:48 GMT, ravi gupta <d...@openjdk.org> wrote:

>> Modify TextAreaTextEventTest.java as to verify the content changes of a both 
>> TextComponent(TextField,TextArea) for the following assertions.
>> 
>> a. TextListener get invoked when the content of a TextField gets changed.
>> b. TextListener not get invoked during text selection or when Special keys 
>> such as Function Keys are pressed.
>> 
>> 
>> Testing:
>> Tested using Mach5(20 times per platform) in macos,linux and windows and got 
>> all pass.
>
> ravi gupta has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Modified TextAreaTextEventTest.java as to verify the content change of 
> TextComponent sends TextEvent

Changes requested by aivanov (Reviewer).

test/jdk/java/awt/event/ComponentEvent/TextComponentTextEventTest.java line 63:

> 61:         TextArea textArea = new TextArea(5, 15);
> 62:         textArea.addTextListener((event) -> {
> 63:             System.out.println("TextArea Got a text event: " + event);

Nit for being consistent:
Suggestion:

            System.out.println("TextArea got a text event: " + event);

test/jdk/java/awt/event/ComponentEvent/TextComponentTextEventTest.java line 88:

> 86:                 EventQueue.invokeAndWait(() -> {
> 87:                     textFieldAt = textComp.getLocationOnScreen();
> 88:                     textFieldSize = textComp.getSize();

Suggestion:

                    textCompAt = textComp.getLocationOnScreen();
                    textCompSize = textComp.getSize();

This makes it clearer that the location and size are of a generic component 
which could be either `textField` or `textArea`.

test/jdk/java/awt/event/ComponentEvent/TextComponentTextEventTest.java line 116:

> 114:                     throw new RuntimeException(
> 115:                         "FAIL: TextEvent triggered when Enter pressed on 
> in "
> 116:                             + textComp);

Suggestion:

                        "FAIL: TextEvent triggered when Enter pressed on "
                            + textComp);

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

PR: https://git.openjdk.org/jdk/pull/11326

Reply via email to