<Swing Dev> Unexpected NullPointerException by endComposition()

Neil Richards neil.richards at ngmr.net
Wed Sep 21 16:05:41 UTC 2011


On Wed, 2011-09-21 at 18:47 +0400, Pavel Porvatov wrote:
> Hi Charles,
> > Hi guys,
> >
> > This issue is related about sunbug 6938583. 
> > (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6938583)
> >
> > I am thinking maybe it can be fixed in the CodePointIM code. The 
> > problem is occurred when the IM is in the compose mode and use left 
> > click the Mouse. Maybe we can consume the left click the event when it 
> > is in the compose mode?
> >
> > The code looks like:
> >
> > if (!notInCompositionMode && (event instanceof MouseEvent)) {
> >     MouseEvent mEvent = (MouseEvent)event;
> >     if (mEvent.getID() == MouseEvent.MOUSE_CLICKED && 
> > mEvent.getButton() == MouseEvent.BUTTON3) {
> >         mEvent.consume();
> >     }
> >     return;
> > }
> >
> > in the dispatchEvent of CodePointInputMethod.
> >
> Could you please send webrev of your fix? Why did you write "consume the 
> left click" but used "mEvent.getButton() == MouseEvent.BUTTON3"? Can you 
> explain why should we consume left clicks but not right ones (or vice 
> versa)?
> 
> Thanks, Pavel
> 

Hi Charles,
If you provide your suggested fix as a patch here, I can webrev-ify it
and get it onto cr.openjdk.java.net for ease of review.

Regards, Neil

-- 
Unless stated above:
IBM email: neil_richards at uk.ibm.com
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU




More information about the swing-dev mailing list