| Summary: | InvalidRegistryObjectException when working with plugin.xml editor and search results | ||
|---|---|---|---|
| Product: | [Eclipse Project] PDE | Reporter: | Tomasz Zarna <tomasz.zarna> |
| Component: | UI | Assignee: | PDE-UI-Inbox <pde-ui-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | aphung.work, curtis.windatt.public, ed, ekke, error-reports-inbox, g.watson, loskutov, markus.kell.r, Michael_Rennie, ob1.eclipse |
| Version: | 3.6 | Keywords: | helpwanted |
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | stalebug | ||
|
Description
Tomasz Zarna
PluginExtension holds on to the IExtension object. The IExtension object can become invalid if the bundle contributing it is unresolved. The handles to registry objects shoudl not be cached, here is the Javadoc from IExtension:
* These registry objects are intended for relatively short-term use. Clients that
* deal with these objects must be aware that they may become invalid if the
* declaring plug-in is updated or uninstalled. If this happens, all methods except
* {@link #isValid()} will throw {@link InvalidRegistryObjectException}.
There are a bunch of similar bugs open, but this bug seems to have spotted the problem (comment #1): > The handles to registry objects shoudl not be cached See https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced&classification=Eclipse&classification=RT&longdesc_type=allwordssubstr&longdesc=InvalidRegistryObjectException+ManifestEditorOpener.findExactMatch cc'ing Mike as when profiling Eclipse he saw some cached registry objects taking up a significant amount of memory. We'll try to investigate in 3.8 I've just seen this in 3.8M5; any progress ? (In reply to comment #4) > I've just seen this in 3.8M5; any progress ? No work is being done on this item. It is marked for 3.8 for consideration during the polish fix period. *** Bug 343749 has been marked as a duplicate of this bug. *** *** Bug 310756 has been marked as a duplicate of this bug. *** *** Bug 219056 has been marked as a duplicate of this bug. *** Just got the same exception in I20130320-2352. Same stack trace except lines numbers are slightly different. Still in 4.8 M5.
Add some extension like:
<extension
point="org.eclipse.ui.activities">
<activity
description="Some activity"
id="PluginA.activity1"
name="name">
</activity>
</extension>
Search for "org.eclipse.ui.activities" references, it will list the extension above.
Change PluginA.activity1 to PluginA.activity2 in the editor and save.
Switch to any other editor and switch back to plugin editor: the exception below is shown.
The problem is that the org.eclipse.pde.internal.ui.search.ManifestEditorOpener.getAttributeMatch(ManifestEditor, IPluginObject, IDocument) tries to compare the IPluginObject with equality, but the current object remembered by the search is not valid anymore and so equals() will throw an Exception while computing element id.
Ideally the search match should be updated on editor change. If this is not possible, one should at least guard the ManifestEditorOpener.getAttributeMatch from those exceptions.
org.eclipse.core.runtime.InvalidRegistryObjectException: Invalid registry object
at org.eclipse.core.internal.registry.RegistryObjectManager.basicGetObject(RegistryObjectManager.java:274)
at org.eclipse.core.internal.registry.RegistryObjectManager.getObject(RegistryObjectManager.java:264)
at org.eclipse.core.internal.registry.BaseExtensionHandle.getExtension(BaseExtensionHandle.java:30)
at org.eclipse.core.internal.registry.BaseExtensionHandle.getUniqueIdentifier(BaseExtensionHandle.java:83)
at org.eclipse.pde.internal.core.plugin.PluginExtension.getId(PluginExtension.java:191)
at org.eclipse.pde.internal.core.plugin.PluginExtension.equals(PluginExtension.java:110)
at org.eclipse.pde.internal.ui.search.ManifestEditorOpener.getAttributeMatch(ManifestEditorOpener.java:152)
at org.eclipse.pde.internal.ui.search.ManifestEditorOpener.findExactMatch(ManifestEditorOpener.java:70)
at org.eclipse.pde.internal.ui.search.SearchResult.computeContainedMatches(SearchResult.java:89)
at org.eclipse.search2.internal.ui.text.EditorAnnotationManager.addAnnotations(EditorAnnotationManager.java:222)
at org.eclipse.search2.internal.ui.text.EditorAnnotationManager.addSearchResult(EditorAnnotationManager.java:109)
at org.eclipse.search2.internal.ui.text.EditorAnnotationManager.setSearchResults(EditorAnnotationManager.java:102)
at org.eclipse.search2.internal.ui.text.WindowAnnotationManager.startHighlighting(WindowAnnotationManager.java:89)
at org.eclipse.search2.internal.ui.text.WindowAnnotationManager.access$1(WindowAnnotationManager.java:82)
at org.eclipse.search2.internal.ui.text.WindowAnnotationManager$1.partVisible(WindowAnnotationManager.java:70)
*** Bug 449993 has been marked as a duplicate of this bug. *** This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |