<AWT Dev> [8] Review request for 8014264: The applet pathguy_TimeDead throws java.lang.NullPointerException in java console once click drop-down check box.

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Tue Jun 11 07:40:05 PDT 2013


ok, then there is a few places, where we call invokeLater on the toolkit 
thread
I find these: XAWTXSettings, probably XMenuBarPeer, LWCToolkit and  
WToolkit.
Some code in dnd is affected also, but am not sure.

On 11.06.2013 14:20, Leonid Romanov wrote:
> If by Toolkit thread you mean the thread that is responsible for 
> obtaining and dispatching platform events, then no, you can't use 
> invokeLater here. The more general rule is that you can't use 
> invokeLater in the main thread group (to which Toolkit thread belongs 
> to).
>
> On 6/11/2013 5:53 PM, Sergey Bylokhov wrote:
>> Hi, Leonid.
>> Does it mean that we cannot use InvokeAndW/Later on the toolkit thread?
>>
>> On 11.06.2013 12:48, Leonid Romanov wrote:
>>> Hi,
>>> Please review a fix for 8014264: The applet pathguy_TimeDead throws 
>>> java.lang.NullPointerException in java console once click drop-down 
>>> check box.
>>> The problem here is that for applets prePostEvent is called within 
>>> ThreadGroup that, by design, has no AppContext associated with it. 
>>> So, when the code in XChoicePeer/XListPeer prePostEvent 
>>> implementation calls EventQueue.invokeLater, it results in NPE 
>>> because there is no EQ for this ThreadGroup.
>>> The fix is not to use invokeLater, but to manually create 
>>> InvocationEvent to ensure that target's AppContext would be used to 
>>> find an EQ for the event to go into.
>>>
>>> Bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8014264
>>> Webrev: http://cr.openjdk.java.net/~leonidr/8014264/webrev.00/ 
>>> <http://cr.openjdk.java.net/%7Eleonidr/8014264/webrev.00/>
>>>
>>> Thanks,
>>> Leonid.
>>>
>>
>>
>


-- 
Best regards, Sergey.



More information about the awt-dev mailing list