RFR: 8316388: Opensource five Swing component related regression tests

Alexander Zuev kizune at openjdk.org
Tue Mar 12 09:38:17 UTC 2024


On Mon, 11 Mar 2024 14:12:33 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> Clean up five more tests.
>> 
>> test/jdk/javax/swing/JDesktopPane/4132993/bug4132993.java
>> test/jdk/javax/swing/JDesktopPane/4773378/bug4773378.java
>> test/jdk/javax/swing/JEditorPane/4325606/bug4325606.java
>> test/jdk/javax/swing/JEditorPane/4330998/bug4330998.java
>> test/jdk/javax/swing/JEditorPane/4694598/FrameContent.html
>> test/jdk/javax/swing/JEditorPane/4694598/bug4694598.java
>
> test/jdk/javax/swing/JEditorPane/4694598/bug4694598.java line 29:
> 
>> 27:  * @summary JEditor pane throws NullPointerException on mouse movement.
>> 28:  * @library ../../regtesthelpers
>> 29:  * @build JRobot
> 
> The test doesn't seem to use any of the extended functionality provided by JRobot, so the standard `java.awt.Robot` can be used instead.

I do not see any harm in using JRobot, it is a Swing test after all.

> test/jdk/javax/swing/JEditorPane/4694598/bug4694598.java line 40:
> 
>> 38: 
>> 39: public class bug4694598 {
>> 40:     JFrame frame = null;
> 
> Suggestion:
> 
>     JFrame frame;
> 
> `null` is the default value any way.

Ok.

> test/jdk/javax/swing/JEditorPane/4694598/bug4694598.java line 81:
> 
>> 79:             try {
>> 80:                 Thread.sleep(50);
>> 81:             } catch (InterruptedException ex) {}
> 
> Suggestion:
> 
>             jRobo.delay(50);

Fixed.

> test/jdk/javax/swing/JEditorPane/4694598/bug4694598.java line 93:
> 
>> 91: 
>> 92:     public static void main(String args[]) throws InterruptedException,
>> 93:             InvocationTargetException {
> 
> Suggestion:
> 
>     public static void main(String[] args) throws Exception {
> 
> Java-style array declaration, shortened `throws` clause.

Switched the array declaration but i would prefer to keep all the exceptions listed in the main method declaration.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18184#discussion_r1521142437
PR Review Comment: https://git.openjdk.org/jdk/pull/18184#discussion_r1521141637
PR Review Comment: https://git.openjdk.org/jdk/pull/18184#discussion_r1521139604
PR Review Comment: https://git.openjdk.org/jdk/pull/18184#discussion_r1521136603


More information about the client-libs-dev mailing list