JDK-4886183 : datatransfer.Clipboard.setContent invokes listeners.flavorsChanged later
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.6
  • CPU: sparc
  • Submitted: 2003-07-03
  • Updated: 2005-01-26
  • Resolved: 2005-01-26
Related Reports
Duplicate :  
Description

Name: sdR10048			Date: 07/03/2003


Filed By      : SPB JCK team (###@###.###)
JDK           : java full version "1.5.0-beta-b09"
JCK           : 1.5

Specification excerpt:
======================
--------- J2SE API spec v.1.5 ---------
...
public void addFlavorListener(FlavorListener?listener)

Registers the specified FlavorListener to receive FlavorEvents 
from this clipboard. If listener is null, no exception is thrown 
and no action is performed.

Parameters:
    listener - the listener to be added


public void setContents(Transferable?contents,
                        ClipboardOwner?owner)

Sets the current contents of the clipboard to the specified 
transferable object  and registers the specified clipboard 
owner as the owner of the new contents. If there is an existing
owner registered, that owner is notified that it no longer 
holds ownership of the clipboard contents. The method throws
IllegalStateException if the clipboard is currently unavailable.
For example, on some platforms, the system clipboard is unavailable
while it is accessed by another application.

Parameters:
    contents - the transferable object representing the clipboard
               content
    owner - the object which owns the clipboard content

Throws:
    IllegalStateException - if the clipboard is currently unavailable

...
---------- end-of-excerpt ---------------

Problem description
===================
Currently when we change Clipboard's DataFlavors (by calling 
Clipboard.setContents method) all registered flavor listeners receive
appropriate FlavorEvent. But setContent uses EventQueue.invokeLater for it.

That has been moved in with CCC 4259272 implementation.

Javadoc says nothing about it, asynchronous behavior should be specified explicitly.

======================================================================

Comments
EVALUATION Name: dk30142 Date: 07/19/2003 Accepted ====================================================================== The asynchronous behavior in question was specified in 4884956. ###@###.### 2005-1-26 12:01:35 GMT
26-01-2005