[jbosstools-issues] [JBoss JIRA] (JBIDE-16320) NPE when dropping a JQM widget from Palette

Daniel Azarov (JIRA) issues at jboss.org
Thu Dec 26 13:49:32 EST 2013


    [ https://issues.jboss.org/browse/JBIDE-16320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12933226#comment-12933226 ] 

Daniel Azarov commented on JBIDE-16320:
---------------------------------------

OK. I did it. There are no crashes and no NPE.

There is a source of method setViewer of class AbstractTool 
{code}
1524	public void setViewer(EditPartViewer viewer) {
1525		if (viewer == currentViewer)
1526			return;
1527
1528		setCursor(null);
1529		currentViewer = viewer;
1530		if (currentViewer != null) {
1530			org.eclipse.swt.graphics.Point p = currentViewer.getControl()
1531					.toControl(Display.getCurrent().getCursorLocation());
1532			getCurrentInput().setMouseLocation(p.x, p.y);
1533		}
1534		refreshCursor();
1535	}
{code}

It means Display.getCurrent() returns null, which means this method was called not from UI thread.
                
> NPE when dropping a JQM widget from Palette
> -------------------------------------------
>
>                 Key: JBIDE-16320
>                 URL: https://issues.jboss.org/browse/JBIDE-16320
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: jsp/jsf/xml/html source editing
>    Affects Versions: 4.2.0.Alpha2
>            Reporter: Alexey Kazakov
>            Assignee: Daniel Azarov
>             Fix For: 4.2.0.Alpha2
>
>
> 1. Create the following html file:
> {code}
> <!DOCTYPE html>
> <html>
> </html>
> {code}
> 2. Open the file with JBoss Tools HTML Editor
> 3. DnD a page from JQM palette
> 4. There is a NPE in Eclipse log:
> {code}
> java.lang.NullPointerException
> 	at org.eclipse.gef.tools.AbstractTool.setViewer(AbstractTool.java:1532)
> 	at org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java:1197)
> 	at org.eclipse.gef.tools.SelectionTool.mouseUp(SelectionTool.java:575)
> 	at org.eclipse.gef.EditDomain.mouseUp(EditDomain.java:301)
> 	at org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouseReleased(DomainEventDispatcher.java:380)
> 	at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(LightweightSystem.java:548)
> 	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:220)
> 	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
> 	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4410)
> 	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1388)
> 	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3760)
> 	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3381)
> 	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
> 	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
> 	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
> 	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:146)
> 	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:613)
> 	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
> 	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
> 	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
> 	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
> 	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
> 	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:109)
> 	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:80)
> 	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:372)
> 	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:226)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:606)
> 	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
> 	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
> 	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
> 	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jbosstools-issues mailing list