On Mon, 18 Dec 2023 03:25:00 GMT, songpv-imt <d...@openjdk.org> wrote:

>> The root cause of the bug is because mousePress() method is invoked before 
>> mouseMove() event is completely processed causing the drag & drop behavior 
>> not being able to be recognized properly. This in turn makes the method 
>> dragSourceListener.isDropFinished() returns false and fail the test. To fix 
>> this, setAutoWaitForIdle(true) and Thread.Sleep is called to make sure the 
>> mouseMove() event is processed completely before moving to execute the 
>> mousePress() method.
>> 
>> JBS issue: [JDK-8317287](https://bugs.openjdk.org/browse/JDK-8317287)
>
> songpv-imt has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Update InterJVMGetDropSuccessTest.java
>   - Replace Thread.sleep by robot.delay
>   - Fix the code's formatting

Both the original test and updated test in this PR pass on the latest macOS 
version 14.2. Since this is a test stabilization fix I would like to suggest a 
change to JBS title to reflect it since the current one might be misleading.

test/jdk/java/awt/dnd/InterJVMGetDropSuccessTest/InterJVMGetDropSuccessTest.java
 line 230:

> 228: 
> 229:     private boolean success1 = false;
> 230:     private boolean success2 = false;

These boolean vars need to be volatile since they are accessed on two different 
threads.

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

Changes requested by honkar (Committer).

PR Review: https://git.openjdk.org/jdk/pull/16396#pullrequestreview-1787940514
PR Review Comment: https://git.openjdk.org/jdk/pull/16396#discussion_r1430800164

Reply via email to