<AWT Dev> [9] Review Request: 8043393 NullPointerException and no event received when clipboard data flavor changes

Petr Pchelko petr.pchelko at oracle.com
Fri May 23 11:37:09 UTC 2014

Hello, Anthony.

> By "delivered incorrectly", what do you mean exactly?
I’ve started to describe you the situation when I realized that the problem is more general, not the corner case as I’ve thought initially.
So the fix is incorrect and I need to take a complicated path here. Sorry for the time wasted on this review, I’ll send a new version as soon
as it will be ready.

With best regards. Petr.

On May 23, 2014, at 3:30 PM, Anthony Petrov <anthony.petrov at oracle.com> wrote:

> Hi Petr,
> On 5/22/2014 7:42 PM, Petr Pchelko wrote:
>> Please review a yet another AppContext fix:
>> https://bugs.openjdk.java.net/browse/JDK-8043393
>> The fix is available here:
>> http://cr.openjdk.java.net/~pchelko/9/8043393/webrev/
>> checkChange method is called on a Toolkit thread, but we are trying to convert formats to flavors there.
>> The conversion needs to to use the SystemFlavorMap which is local to AppContext. But really we can
>> avoid conversion and compare native formats.
>> This fix is not absolutely precise: in case we have several applets in one VM and each applet have set it's own
>> different flavor mapping, it's possible (but highly unlikely) that a notification would be delivered incorrectly.
> By "delivered incorrectly", what do you mean exactly?
> The crux of the fix is to get rid of a call to formatArrayAsDataFlavorSet(). Do I understand correctly that the size() of the returned Set<> may not be equal to the length of the formats array passed as an argument to this method? Why could this happen?
> Also, what is the order of longs stored in this array? Are we certain it's always the same, and so the Arrays.equals() does the right thing? Or should we sort the arrays first?
> --
> best regards,
> Anthony
>> But fixing that imaginary bug would require enormous amount of changes in Clipboard event delivery and will make
>> it way harder to modularize the DataTransfer system. So I believe that a simple solution would work better here.
>> I can file a new P4 bug for the described scenario to address it after I finish DataTransfer modularization.
>> With best regards. Petr.

More information about the awt-dev mailing list