Community
Participate
Working Groups
Build ID: 3.4 M5 I20080207-1530 Steps To Reproduce: 1. Open two different plugin.xml files, one in the "plugin.xml" (plain text view) tab, another one on "Extensions". This two plugin.xml files should contain different contributions 2. Switch from xml editor tab of one editor to the extensions tab of another 3. You see an exception: org.eclipse.core.runtime.InvalidRegistryObjectException: Invalid registry object at org.eclipse.core.internal.registry.RegistryObjectManager.basicGetObject(RegistryObjectManager.java:273) at org.eclipse.core.internal.registry.RegistryObjectManager.getObject(RegistryObjectManager.java:263) at org.eclipse.core.internal.registry.BaseExtensionHandle.getExtension(BaseExtensionHandle.java:30) at org.eclipse.core.internal.registry.BaseExtensionHandle.getUniqueIdentifier(BaseExtensionHandle.java:67) at org.eclipse.pde.internal.core.plugin.PluginExtension.getId(PluginExtension.java:186) at org.eclipse.pde.internal.core.plugin.PluginExtension.equals(PluginExtension.java:111) at org.eclipse.pde.internal.ui.search.ManifestEditorOpener.getAttributeMatch(ManifestEditorOpener.java:100) at org.eclipse.pde.internal.ui.search.ManifestEditorOpener.findExactMatch(ManifestEditorOpener.java:46) at org.eclipse.pde.internal.ui.search.SearchResult.computeContainedMatches(SearchResult.java:96) at org.eclipse.search2.internal.ui.text.EditorAnnotationManager.addAnnotations(EditorAnnotationManager.java:221) at org.eclipse.search2.internal.ui.text.EditorAnnotationManager.addSearchResult(EditorAnnotationManager.java:108) at org.eclipse.search2.internal.ui.text.EditorAnnotationManager.setSearchResults(EditorAnnotationManager.java:101) at org.eclipse.search2.internal.ui.text.WindowAnnotationManager.startHighlighting(WindowAnnotationManager.java:82) at org.eclipse.search2.internal.ui.text.WindowAnnotationManager.access$1(WindowAnnotationManager.java:75) at org.eclipse.search2.internal.ui.text.WindowAnnotationManager$1.partVisible(WindowAnnotationManager.java:64) at org.eclipse.ui.internal.PartListenerList2$7.run(PartListenerList2.java:170) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:857) at org.eclipse.ui.internal.PartListenerList2.fireEvent(PartListenerList2.java:53) at org.eclipse.ui.internal.PartListenerList2.firePartVisible(PartListenerList2.java:168) at org.eclipse.ui.internal.PartService.firePartVisible(PartService.java:121) at org.eclipse.ui.internal.WWinPartService$1.partVisible(WWinPartService.java:60) at org.eclipse.ui.internal.PartListenerList2$7.run(PartListenerList2.java:170) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:857) at org.eclipse.ui.internal.PartListenerList2.fireEvent(PartListenerList2.java:53) at org.eclipse.ui.internal.PartListenerList2.firePartVisible(PartListenerList2.java:168) at org.eclipse.ui.internal.PartService.firePartVisible(PartService.java:121) at org.eclipse.ui.internal.WorkbenchPagePartList.firePartVisible(WorkbenchPagePartList.java:67) at org.eclipse.ui.internal.PartList.partVisible(PartList.java:269) at org.eclipse.ui.internal.PartList.access$2(PartList.java:258) at org.eclipse.ui.internal.PartList$1.propertyChanged(PartList.java:44) at org.eclipse.ui.internal.WorkbenchPartReference.fireInternalPropertyChange(WorkbenchPartReference.java:374) at org.eclipse.ui.internal.WorkbenchPartReference.fireVisibilityChange(WorkbenchPartReference.java:535) at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:305) ... or java.lang.NullPointerException at org.eclipse.pde.internal.core.plugin.PluginAttribute.equals(PluginAttribute.java:51) at org.eclipse.pde.internal.core.plugin.PluginElement.equals(PluginElement.java:83) at org.eclipse.pde.internal.core.plugin.PluginParent.equals(PluginParent.java:68) at org.eclipse.pde.internal.core.plugin.PluginExtension.equals(PluginExtension.java:118) at org.eclipse.pde.internal.ui.search.ManifestEditorOpener.getAttributeMatch(ManifestEditorOpener.java:100) at org.eclipse.pde.internal.ui.search.ManifestEditorOpener.findExactMatch(ManifestEditorOpener.java:46) at org.eclipse.pde.internal.ui.search.SearchResult.computeContainedMatches(SearchResult.java:96) at org.eclipse.search2.internal.ui.text.EditorAnnotationManager.addAnnotations(EditorAnnotationManager.java:221) at org.eclipse.search2.internal.ui.text.EditorAnnotationManager.addSearchResult(EditorAnnotationManager.java:108) at org.eclipse.search2.internal.ui.text.EditorAnnotationManager.setSearchResults(EditorAnnotationManager.java:101) at org.eclipse.search2.internal.ui.text.WindowAnnotationManager.startHighlighting(WindowAnnotationManager.java:82) at org.eclipse.search2.internal.ui.text.WindowAnnotationManager.access$1(WindowAnnotationManager.java:75) at org.eclipse.search2.internal.ui.text.WindowAnnotationManager$1.partVisible(WindowAnnotationManager.java:64) at org.eclipse.ui.internal.PartListenerList2$7.run(PartListenerList2.java:170) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:857) at org.eclipse.ui.internal.PartListenerList2.fireEvent(PartListenerList2.java:53) at org.eclipse.ui.internal.PartListenerList2.firePartVisible(PartListenerList2.java:168) at org.eclipse.ui.internal.PartService.firePartVisible(PartService.java:121) at org.eclipse.ui.internal.WWinPartService$1.partVisible(WWinPartService.java:60) at org.eclipse.ui.internal.PartListenerList2$7.run(PartListenerList2.java:170) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:857) at org.eclipse.ui.internal.PartListenerList2.fireEvent(PartListenerList2.java:53) at org.eclipse.ui.internal.PartListenerList2.firePartVisible(PartListenerList2.java:168) at org.eclipse.ui.internal.PartService.firePartVisible(PartService.java:121) at org.eclipse.ui.internal.WorkbenchPagePartList.firePartVisible(WorkbenchPagePartList.java:67) at org.eclipse.ui.internal.PartList.partVisible(PartList.java:269) at org.eclipse.ui.internal.PartList.access$2(PartList.java:258) at org.eclipse.ui.internal.PartList$1.propertyChanged(PartList.java:44) at org.eclipse.ui.internal.WorkbenchPartReference.fireInternalPropertyChange(WorkbenchPartReference.java:374) at org.eclipse.ui.internal.WorkbenchPartReference.fireVisibilityChange(WorkbenchPartReference.java:535) at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:305) at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180)
Interesting... somehow you got to the point where you were searching extension results for a model that wasn't in PDE's model anymore... I added some saftety checks to ManifestEditorOpener to make sure this doesn't happen. I wasn't able to reproduce this particular issue so please reopen if this remains an issue in the future.
>20080215
Created attachment 89850 [details] mylyn/context/zip
Chris, I still get those exceptions with I20080502-0100 (aka M7). I can reproduce the NPE with the following scenario: 1. create a new plug-in project 2. the manifest editor should open by default, go the extension tab, add an extension for org.eclipse.ui.activities and create a dummy activity. Save. 3. switch to the "plugin.xml" tab, select "org.eclipse.ui.activities", press CTRL-H to open the search dialog, ensure the "Plug-in Search" tab is selected, search for references to this extension point. You should have some matches and at least org.eclipse.equinox.p2.ui.sdk 4. double-click on org.eclipse.equinox.p2.ui.sdk in the search view, a new manifest editor opens. 5. switch to the first manifest editor -> NPE. Then everytime I switch to this editor I get the NPE, however if a clear the search view, the NPE disapears ...
I tried in I20080516-1333 and I didn't get them :/
Well, I just tried with I20080516-1333 (RC1) and I still get the NPE ... With the scenario I mentioned (plugin id = "com.foo.bar"), the plugin attributes are compared in PluginElement.equals(): att.fName = "id" att.fModel = a model (underlying resource = L/com.foo.bar/plugin.xml) att.fValue = "com.foo.bar.activity1" tatt.fName = "id" tatt.fModel = null tatt.fValue = "com.foo.bar.activity1" then 'att.equals(tatt) == false' is evaluated and as getModel() returns null an NPE is thrown when executing 'target.getModel().equals(getModel())' ('target' == 'tatt') Just to clarify the scenario, after step 2) the content of plugin.xml is: <?xml version="1.0" encoding="UTF-8"?> <?eclipse version="3.2"?> <plugin> <extension point="org.eclipse.ui.activities"> <activity id="com.foo.bar.activity1" name="name"> </activity> </extension> </plugin> I can do some more debugging if you tell me where to look.
reopening to add more safety to at least not get the NPE
will add the NPE guard
Created attachment 101514 [details] Protects against NPE Chris is having problems with CVS while travelling. This is his suggested fix that simply guards against the NPE.
Adding reviewers for an RC2 fix.
+1 Thanks!
+1 from me.
+1
Humm, I'm totally unfamiliar with the code and I haven't applied the patch, but the NPE is triggered because 'PluginAttribute.getModel()' returns 'null', so is it correct to test 'PluginElement.getModel()' ? Moreover, the problem is not related to 'this.getModel()' but to 'target.getModel()', so I was more expecting a test like 'if (target.getModel() == null) return false' in 'PluginAttribute.equals()' ... But once again I'm just looking at the call stack so I may be missing some invariants/properties ...
(In reply to comment #14) > Humm, I'm totally unfamiliar with the code and I haven't applied the patch, but > the NPE is triggered because 'PluginAttribute.getModel()' returns 'null', so is > it correct to test 'PluginElement.getModel()' ? Correct, this is also a possible problem. The patch will be updated and released once I can commit, currenlty at the e4 summit where SSH is blocked.
moving to RC3, I investigated this issue today and there's some other pervasive problem that causes this NPE that I need to track down before I put the NPE guard.
Created attachment 101691 [details] org.eclipse.pde.core.patch This NPE was cause by a missing model. The root cause of this is was that we forget to assign our plugin attribute a model when created via the extension editor.
Please review for our obligatory +1's :)
+1, nothing better than a good root cause analysis :-)
+1 again
done. > 20080525
Created attachment 101900 [details] mylyn/context/zip
I see it again in RC3 (eclipse.buildId=I20080530-1730), probably exactly the same stack as reported at very beginning... Use case is to search for extension point references from your project's plugin xml, open some resulting plugin.xml's, close them and switch back to the origin: org.eclipse.core.runtime.InvalidRegistryObjectException: Invalid registry object at org.eclipse.core.internal.registry.RegistryObjectManager.basicGetObject(RegistryObjectManager.java:273) at org.eclipse.core.internal.registry.RegistryObjectManager.getObject(RegistryObjectManager.java:263) at org.eclipse.core.internal.registry.BaseExtensionHandle.getExtension(BaseExtensionHandle.java:30) at org.eclipse.core.internal.registry.BaseExtensionHandle.getUniqueIdentifier(BaseExtensionHandle.java:67) at org.eclipse.pde.internal.core.plugin.PluginExtension.getId(PluginExtension.java:186) at org.eclipse.pde.internal.core.plugin.PluginExtension.equals(PluginExtension.java:111) at org.eclipse.pde.internal.ui.search.ManifestEditorOpener.getAttributeMatch(ManifestEditorOpener.java:134) at org.eclipse.pde.internal.ui.search.ManifestEditorOpener.findExactMatch(ManifestEditorOpener.java:51) at org.eclipse.pde.internal.ui.search.SearchResult.computeContainedMatches(SearchResult.java:96) at org.eclipse.search2.internal.ui.text.EditorAnnotationManager.addAnnotations(EditorAnnotationManager.java:221) at org.eclipse.search2.internal.ui.text.EditorAnnotationManager.addSearchResult(EditorAnnotationManager.java:108) at org.eclipse.search2.internal.ui.text.EditorAnnotationManager.setSearchResults(EditorAnnotationManager.java:101) at org.eclipse.search2.internal.ui.text.WindowAnnotationManager.startHighlighting(WindowAnnotationManager.java:82) at org.eclipse.search2.internal.ui.text.WindowAnnotationManager.access$1(WindowAnnotationManager.java:75) at org.eclipse.search2.internal.ui.text.WindowAnnotationManager$1.partVisible(WindowAnnotationManager.java:64) at org.eclipse.ui.internal.PartListenerList2$7.run(PartListenerList2.java:170) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:880) at org.eclipse.ui.internal.PartListenerList2.fireEvent(PartListenerList2.java:53) at org.eclipse.ui.internal.PartListenerList2.firePartVisible(PartListenerList2.java:168) at org.eclipse.ui.internal.PartService.firePartVisible(PartService.java:252) at org.eclipse.ui.internal.WWinPartService$1.partVisible(WWinPartService.java:60) at org.eclipse.ui.internal.PartListenerList2$7.run(PartListenerList2.java:170) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:880) at org.eclipse.ui.internal.PartListenerList2.fireEvent(PartListenerList2.java:53) at org.eclipse.ui.internal.PartListenerList2.firePartVisible(PartListenerList2.java:168) at org.eclipse.ui.internal.PartService.firePartVisible(PartService.java:252) at org.eclipse.ui.internal.WorkbenchPagePartList.firePartVisible(WorkbenchPagePartList.java:67) at org.eclipse.ui.internal.PartList.partVisible(PartList.java:269) at org.eclipse.ui.internal.PartList.access$2(PartList.java:258) at org.eclipse.ui.internal.PartList$1.propertyChanged(PartList.java:44) at org.eclipse.ui.internal.WorkbenchPartReference.fireInternalPropertyChange(WorkbenchPartReference.java:374) at org.eclipse.ui.internal.WorkbenchPartReference.fireVisibilityChange(WorkbenchPartReference.java:535) at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:311) at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180)
we will have to investigate for 3.4.1 as 3.4 is coming to a close and we're all dying writing documentation :)
*** Bug 237739 has been marked as a duplicate of this bug. ***
*** Bug 241004 has been marked as a duplicate of this bug. ***
Moving to 3.5, since there is no fix in hand and investigation was not done in the 3.4.1 time frame.
I'm not sure what exactly is triggering this in my case, but once it is triggered, it happens every time I open the plug-in editor. I have not found a way to make it disappear except to restart Eclipse. It is quite an annoyance and I will try to find a consistent way to reproduce it. Any hope for 3.4.2?
moving to RC2 for investigation. This one has plagued us for awhile but the ability to not reproduce makes it hard to fix. It's most likely a race condition somewhere if it's still around.
Without a reproduceable case/fix is this really RC2?
No plans to work on this for RC2.
*** Bug 287973 has been marked as a duplicate of this bug. ***
We have to try to reproduce using the steps from bug 287973
There are many bugs referencing the same InvalidRegistryObjectException with different steps. They are being merged into Bug 299636. *** This bug has been marked as a duplicate of bug 299636 ***