RFR: 8306943: Open source several dnd AWT tests [v2]

Alexander Zvegintsev azvegint at openjdk.org
Wed May 3 21:05:45 UTC 2023


On Tue, 2 May 2023 19:54:45 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> Alexander Zvegintsev has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   add volatile
>
> test/jdk/java/awt/dnd/DnDAWTLockTest.java line 150:
> 
>> 148:             public void run() {
>> 149:                 try {
>> 150:                     if (process == null) {
> 
> do we need to add a sync for process and sourcePoint?

I don't think so.

`lostOwnership` is called when some other client changes the contents of the clipboard.
It can be either our `Child` process or other programs in the system. 
In first case `process` and `sourcePoint` are not `null` by this time.
In the second case, it will also mean a test failure because the test expects a very certain clipboard content.

I made them volatile just in case, since they are accessed from several threads.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13752#discussion_r1184276306



More information about the client-libs-dev mailing list