Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 334561

Summary: [Pin&Clone] ServiceRegistration returns null pointer
Product: [Tools] CDT Reporter: Patrick Chuong <pchuong>
Component: cdt-debug-dsfAssignee: Project Inbox <cdt-debug-dsf-inbox>
Status: NEW --- QA Contact: Jonah Graham <jonah>
Severity: normal    
Priority: P3 CC: cdtdoug, marc.khouzam
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Patrick Chuong CLA 2011-01-17 13:39:02 EST
During the initializatoin Job for the pin ViewIDCounterManager, calling IViewReference#getView(true) result in a nullpointer exception. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=331781#c29, for more detail. The current workaround is to call getView(false) and listen to partOpened to reset the title.


org.eclipse.pde.internal.runtime.registry.model.ServiceRegistration.getUsingBundles(ServiceRegistration.java:76)
>     at
> org.eclipse.pde.internal.runtime.registry.RegistryBrowserModelChangeListener.getTopLevelElement(RegistryBrowserModelChangeListener.java:63)
>     at
> org.eclipse.pde.internal.runtime.registry.RegistryBrowserModelChangeListener.refreshTopLevelElements(RegistryBrowserModelChangeListener.java:99)
>     at
> org.eclipse.pde.internal.runtime.registry.RegistryBrowserModelChangeListener.update(RegistryBrowserModelChangeListener.java:129)
>     at
> org.eclipse.pde.internal.runtime.registry.RegistryBrowserModelChangeListener$1.run(RegistryBrowserModelChangeListener.java:26)
>     at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
>     at
> org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
Comment 1 Marc Khouzam CLA 2011-01-17 13:57:23 EST
(In reply to comment #0)
> During the initializatoin Job for the pin ViewIDCounterManager, calling
> IViewReference#getView(true) result in a nullpointer exception.

Note that the NPE does not happen when we call IViewReference#getView(true) but will eventually happen when we terminate a DSF-GDB launch.
Comment 2 Patrick Chuong CLA 2011-01-17 14:00:29 EST
(In reply to comment #1)
> (In reply to comment #0)
> > During the initializatoin Job for the pin ViewIDCounterManager, calling
> > IViewReference#getView(true) result in a nullpointer exception.
> Note that the NPE does not happen when we call IViewReference#getView(true) but
> will eventually happen when we terminate a DSF-GDB launch.

I still can't reproduce this NPE, I am able to terminate the session without issue. I am wondering whether this is related to linux or not. I'll need to setup my linux VM and give it a try.
Comment 3 Marc Khouzam CLA 2011-01-17 14:03:10 EST
(In reply to comment #2)
> (In reply to comment #1)
> > (In reply to comment #0)
> > > During the initializatoin Job for the pin ViewIDCounterManager, calling
> > > IViewReference#getView(true) result in a nullpointer exception.
> > Note that the NPE does not happen when we call IViewReference#getView(true) but
> > will eventually happen when we terminate a DSF-GDB launch.
> 
> I still can't reproduce this NPE, I am able to terminate the session without
> issue. I am wondering whether this is related to linux or not. I'll need to
> setup my linux VM and give it a try.

For me (on Linux) it happens all the time.
I can try it on Windows tonight.