On Thu, 16 Apr 2026 16:17:49 GMT, Alexey Ivanov <[email protected]> wrote:

>> Khalid Boulanouare has updated the pull request incrementally with nine 
>> additional commits since the last revision:
>> 
>>  - Runs getLocationOnScreen abd getPreferredSize in EDT and re-orders 
>> sequence of execution in performTest method
>>  - Formats code
>>  - Formats code and re-orders sequence of execution in performTest
>>  - Formats code and removes unnecessary imports
>>  - Formats code and removes unnecessary fields
>>  - Restores file, no changes needed
>>  - Adds comment on mouse move and removes duplicate setLocationRelativeTo
>>  - Removes unnecessary import and adds comment on mouse move
>>  - Updates formatting and adds comment on mouse move
>
> test/jdk/java/awt/Mixing/AWT_Mixing/GlassPaneOverlappingTestBase.java line 
> 124:
> 
>> 122:             return true;
>> 123:         }
>> 124:         final CountDownLatch latch = new CountDownLatch(1);
> 
> Suggestion:
> 
> 
>         final CountDownLatch latch = new CountDownLatch(1);
> 
> I believe the blank line here makes perfect sense to separate the early 
> returns from the rest of the method.

Done!

> test/jdk/java/awt/Mixing/AWT_Mixing/GlassPaneOverlappingTestBase.java line 
> 152:
> 
>> 150:         } catch (InterruptedException | InvocationTargetException ex) {
>> 151:             fail(ex.getMessage());
>> 152:             return false;
> 
> It seems like `return false` isn't needed because `fail` throws an exception.

Done!

> test/jdk/java/awt/Mixing/AWT_Mixing/GlassPaneOverlappingTestBase.java line 
> 169:
> 
>> 167:             if (!edtLatch.await(1, TimeUnit.SECONDS)) {
>> 168:                 throw new RuntimeException("Point location was not 
>> received!");
>> 169:             }
> 
> Can the code to get the location of the tested component be placed here?
> 
> The method could look like follows:
> 
> <details>
> <summary><code>performTest</code> method</summary>
> 
> 
>     @Override
>     protected boolean performTest() {
>         if (!super.performTest()) {
>             return false;
>         }
>         if (!testResize) {
>             return true;
>         }
> 
>         final CountDownLatch latch = new CountDownLatch(1);
>         f.addFocusListener(new FocusAdapter() {
>             @Override
>             public void focusGained(FocusEvent e) {
>                 latch.countDown();
>             }
>         });
> 
>         wasLWClicked = false;
>         try {
>             SwingUtilities.invokeAndWait(new Runnable() {
> 
>                 public void run() {
>                     testedComponent.setBounds(0, 0,
>                                               
> testedComponent.getPreferredSize().width,
>                                               
> testedComponent.getPreferredSize().height + 20);
>                     Component focusOwner = KeyboardFocusManager
>                             .getCurrentKeyboardFocusManager()
>                             .getFocusOwner();
>                     if (focusOwner == f) {
>                         // frame already has focus
>                         latch.countDown();
>                     } else {
>                         f.requestFocusInWindow();
>                     }
>                 }
>             });
> 
>             if (!latch.await(1, TimeUnit.SECONDS)) {
>                 throw new RuntimeException("Ancestor frame didn't receive 
> focus");
>             }
> 
>             final Point[] points = new Point[1];
>             SwingUtilities.invokeAndWait(() -> {
>                 Point lLoc = testedComponent.getLocationOnScreen();
>                 lLoc.translate(1, testedComponent.getPreferredSize().height + 
> 1);
>                 points[0] = lLoc;
>             });
> 
>             clickAndBlink(robot, points[0]);
>         } catch (InterruptedException | InvocationTargetException ex) {
>             fail(ex.getMessage());
>         }
> 
>         return wasLWClicked;
>     }
> 
> 
> </details>

Done! Testing changes in progress.

> test/jdk/java/awt/Mixing/AWT_Mixing/JComboBoxOverlapping.java line 29:
> 
>> 27: import java.awt.event.ActionEvent;
>> 28: import java.awt.event.ActionListener;
>> 29: import java.lang.Override;
> 
> Suggestion:
> 
> 
> I still see `java.lang.Override` in the list of imports.

Done! I have removed auto import from formatting. This will not happen again.

> test/jdk/java/awt/Mixing/AWT_Mixing/JPopupMenuOverlapping.java line 29:
> 
>> 27: import java.awt.event.ActionEvent;
>> 28: import java.awt.event.ActionListener;
>> 29: import java.lang.Override;
> 
> Suggestion:

Done!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26625#discussion_r3099535262
PR Review Comment: https://git.openjdk.org/jdk/pull/26625#discussion_r3099537007
PR Review Comment: https://git.openjdk.org/jdk/pull/26625#discussion_r3099541169
PR Review Comment: https://git.openjdk.org/jdk/pull/26625#discussion_r3099547645
PR Review Comment: https://git.openjdk.org/jdk/pull/26625#discussion_r3099550319

Reply via email to