On Tue, 17 Feb 2026 13:21:28 GMT, Khalid Boulanouare <[email protected]> 
wrote:

>> This PR will consolidate fixes of the following bugs:
>> 
>> https://bugs.openjdk.org/browse/JDK-8361188
>> https://bugs.openjdk.org/browse/JDK-8361189
>> https://bugs.openjdk.org/browse/JDK-8361190
>> https://bugs.openjdk.org/browse/JDK-8361191
>> https://bugs.openjdk.org/browse/JDK-8361192
>> https://bugs.openjdk.org/browse/JDK-8361193
>> https://bugs.openjdk.org/browse/JDK-8361195
>> 
>> This PR depends on https://github.com/openjdk/jdk/pull/25971
>> 
>> For test : java/awt/Mixing/AWT_Mixing/JComboBoxOverlapping.java, the fix 
>> suggested is to return false in method isValidForPixelCheck for embedded 
>> frame, in which case the component is set to null. For more details see bug: 
>> [JDK-8361188](https://bugs.openjdk.org/browse/JDK-8361188)
>> 
>> For test : test/jdk/java/awt/Mixing/AWT_Mixing/MixingPanelsResizing.java, I 
>> had to create a a tolerance color matching method for mac for the tests to 
>> pass. Also, the jbuttons needed to have different color than the color of 
>> the background frame, in order for test to pass. For more detail see bug: 
>> https://bugs.openjdk.org/browse/JDK-8361193
>> 
>> For test : test/jdk/java/awt/Mixing/AWT_Mixing/JSplitPaneOverlapping.java, 
>> it seems that color selected for lightweight component matches the 
>> background color of the frame. And this will cause the test to fail when 
>> matching colors. Choosing any color different than the background color will 
>> get the test to pass. For more details, see bug: 
>> https://bugs.openjdk.org/browse/JDK-8361192
>> 
>> For test test/jdk/java/awt/Mixing/AWT_Mixing/JPopupMenuOverlapping.java, it 
>> looks like the frame when visible, the popup test does not work properly. 
>> The frame needs to be hidden for the test to click on popup. For more 
>> details see bug: https://bugs.openjdk.org/browse/JDK-8361191
>> 
>> For test test/jdk/java/awt/Mixing/AWT_Mixing/JMenuBarOverlapping.java, the 
>> test runs successfully but it times out after the default 2 minutes of 
>> jtreg. increasing the timeout to 3 minutes get the test to pass. For more 
>> details please refer to bug: https://bugs.openjdk.org/browse/JDK-8361190
>
> 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

Changes requested by aivanov (Reviewer).

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.

test/jdk/java/awt/Mixing/AWT_Mixing/GlassPaneOverlappingTestBase.java line 143:

> 141:                             .getFocusOwner();
> 142:                     if (focusOwner == f) {
> 143:                         // frame already had focus

Suggestion:

                        // frame already has focus

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.

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>

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.

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:

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

PR Review: https://git.openjdk.org/jdk/pull/26625#pullrequestreview-4122525127
PR Review Comment: https://git.openjdk.org/jdk/pull/26625#discussion_r3094700083
PR Review Comment: https://git.openjdk.org/jdk/pull/26625#discussion_r3094712278
PR Review Comment: https://git.openjdk.org/jdk/pull/26625#discussion_r3094761854
PR Review Comment: https://git.openjdk.org/jdk/pull/26625#discussion_r3094828154
PR Review Comment: https://git.openjdk.org/jdk/pull/26625#discussion_r3094846216
PR Review Comment: https://git.openjdk.org/jdk/pull/26625#discussion_r3094889860

Reply via email to