Bug 197550

Summary: [Refresh][Regression] NPE Errors when Refreshing
Product: [Tools] Target Management Reporter: Kevin Doyle <kjdoyle>
Component: RSEAssignee: Martin Oberhuber <mober.at+eclipse>
Status: CLOSED FIXED QA Contact: Martin Oberhuber <mober.at+eclipse>
Severity: major    
Priority: P1 CC: dmcknigh, xuanchen
Version: 2.0   
Target Milestone: 2.0.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 197484    
Bug Blocks:    
Attachments:
Description Flags
Patch fixing the NPE none

Description Kevin Doyle CLA 2007-07-23 17:18:30 EDT
After refreshing a couple of expanded folders on dstore, ssh, or ftp I get a NPE error.

Error Log:
Unhandled event loop exception

org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)
at org.eclipse.swt.SWT.error(SWT.java:3563)
at org.eclipse.swt.SWT.error(SWT.java:3481)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:126)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3659)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3296)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:504)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
at org.eclipse.equinox.launcher.Main.run(Main.java:1169)
at org.eclipse.equinox.launcher.Main.main(Main.java:1144)
Caused by: java.lang.NullPointerException
at org.eclipse.rse.internal.ui.view.SystemViewLabelAndContentProvider.hasChildren(SystemViewLabelAndContentProvider.java:393)
at org.eclipse.rse.internal.ui.view.SystemView.isExpandable(SystemView.java:5969)
at org.eclipse.jface.viewers.AbstractTreeViewer.isExpandable(AbstractTreeViewer.java:2040)
at org.eclipse.jface.viewers.AbstractTreeViewer.updateChildren(AbstractTreeViewer.java:2462)
at org.eclipse.jface.viewers.AbstractTreeViewer.updateChildren(AbstractTreeViewer.java:2434)
at org.eclipse.rse.internal.ui.view.SystemView.internalRSERefreshStruct(SystemView.java:3140)
at org.eclipse.rse.internal.ui.view.SystemView.internalRSERefreshStruct(SystemView.java:3151)
at org.eclipse.rse.internal.ui.view.SystemView.internalRefreshStruct(SystemView.java:3124)
at org.eclipse.jface.viewers.AbstractTreeViewer.internalRefresh(AbstractTreeViewer.java:1797)
at org.eclipse.jface.viewers.AbstractTreeViewer.internalRefresh(AbstractTreeViewer.java:1753)
at org.eclipse.jface.viewers.AbstractTreeViewer.internalRefresh(AbstractTreeViewer.java:1739)
at org.eclipse.rse.internal.ui.view.SystemView.doOurInternalRefresh(SystemView.java:3113)
at org.eclipse.rse.internal.ui.view.SystemView.ourInternalRefresh(SystemView.java:3062)
at org.eclipse.rse.internal.ui.view.SystemView.smartRefresh(SystemView.java:3426)
at org.eclipse.rse.internal.ui.view.SystemView.smartRefresh(SystemView.java:3390)
at org.eclipse.rse.internal.ui.view.SystemView.refreshRemoteObject(SystemView.java:2978)
at org.eclipse.rse.internal.ui.view.SystemView$ResourceChangedJob.runInUIThread(SystemView.java:2207)
at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:94)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
... 23 more


-----------Enter bugs above this line-----------
TM 2.0 Testing
installation : eclipse-SDK-3.3
RSE install  : RSE 2.0
java.runtime : Sun 1.5.0_11-b03
os.name:     : Windows XP, Service Pack 2
------------------------------------------------
Comment 1 Martin Oberhuber CLA 2007-07-23 18:29:41 EDT
*** Bug 197551 has been marked as a duplicate of this bug. ***
Comment 2 Martin Oberhuber CLA 2007-07-23 18:56:32 EDT
Created attachment 74402 [details]
Patch fixing the NPE

Problem was that with the fix for bug #197484, we were also wrapping the "Pending" node from the DeferredWorkbenchAdapter with a ContextObject. But that "Pending" node does not have an ISystemViewElementAdapter associated.

Slightly changing the logic to unwrap the element in case no adapter is registered fixes the issue.
Comment 3 Martin Oberhuber CLA 2007-07-23 19:11:21 EDT
Patch committed and released for I20070723-1930:

[197550] Fix NPE when refreshing Pending items
   SystemViewLabelAndContentProvider
Comment 4 Kevin Doyle CLA 2007-07-24 09:20:38 EDT
Verified with I20070724-0735.