RFR: 8340193: Open source several AWT Dialog tests - Batch 1 [v2]

Prasanta Sadhukhan psadhukhan at openjdk.org
Fri Sep 27 11:57:38 UTC 2024


On Fri, 27 Sep 2024 10:05:34 GMT, Tejesh R <tr at openjdk.org> wrote:

>> test/jdk/java/awt/Dialog/DialogResizeTest.java line 133:
>> 
>>> 131:     public void componentHidden(ComponentEvent e) {
>>> 132:         System.out.println("componentHidden event occurred.");
>>> 133:     }
>> 
>> I guess PassFailJFrame.log would be of more use than System println, if at all these logs are of any help..
>
> I'm getting this error if I use ` PassFailJFrame.log`  to `componentResize` method.
> `java.lang.NullPointerException: Cannot invoke "javax.swing.JTextArea.append(String)" because "PassFailJFrame.logArea" is null`. Since the test is about resize, I've updated only resize related print statement.

Probably component is resized even before PassFailJFrame creates the logArea in Builder interface.
The instructions says 
"When isResizable is true the dialog is resizable. When isResizable is false the dialog is non-resizable" and you are logging "PassFailJFrame.log("isResizable is set to: " + bResizeState);" 

so, it seems ComponentListener is not needed and all these 4 methods can be removed which is only logging and that too is not visible to tester...

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21174#discussion_r1778500627


More information about the client-libs-dev mailing list