Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 348795 - sapphire-extension.xml can be found multiple times by ExtensionsLocatorFactory due to buddy classloading
Summary: sapphire-extension.xml can be found multiple times by ExtensionsLocatorFactor...
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Sapphire (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Konstantin Komissarchik CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-08 15:15 EDT by Greg Amerson CLA
Modified: 2021-11-19 09:21 EST (History)
1 user (show)

See Also:


Attachments
deleted patch (1.77 KB, patch)
2011-06-08 15:19 EDT, Greg Amerson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Amerson CLA 2011-06-08 15:15:38 EDT
In my development environment I have added a META-INF/sapphire-extension.xml to one of my plugins.  However, I'm seeing some weird behavior where Sapphire is reading my extension file twice.  This is causing my action that I have listed in the sapphire-extension.xml to be found 2x in the ExtensionsLocatorFactory.  The factory find() method will find the framework URL to my sapphire-extension.xml from two different bundleHosts, my own plugin and also org.eclipse.emf.ecore.  

Actually the extension locator find() method shows that emf.ecore is returning 4 duplicated URLs, my own sapphire-extension.xml and also 3 other duplicated URLs, sapphire.samples, sapphire.swt.graphiti and sapphire.sdk bundles.  

After debugging find() routine I noticed that BundleLoader#findResources() line 709, is returning my sapphire-extension.xml from both my bundle and from the "emf.ecore" BundleLoader which it is getting from buddy policy resource loading.
Comment 1 Greg Amerson CLA 2011-06-08 15:19:47 EDT
Created attachment 197632 [details]
deleted patch

In this patch modified ExtensionsLocatorFactory to do a small bit of checking to make sure that we don't have add new Handle() object where there has already been a Handle added that holds that same URL
Comment 2 Konstantin Komissarchik CLA 2011-06-08 15:23:04 EDT
Now you've done it. I guess I can pretend, I haven't seen that patch... Unless you are fine with waiting until 0.3.1 for this to be fixed...
Comment 3 Greg Amerson CLA 2011-06-08 15:24:57 EDT
Can I delete the patch? :)
Comment 4 Konstantin Komissarchik CLA 2011-06-08 15:27:51 EDT
Yeah. Go ahead. Sorry for the misunderstanding. I should have some time to fix this for the 0.3 release, so you don't have to work around on your end.
Comment 5 Greg Amerson CLA 2011-06-08 16:04:36 EDT
Comment on attachment 197632 [details]
deleted patch

patched removed
Comment 6 Greg Amerson CLA 2011-06-08 16:05:14 EDT
Comment on attachment 197632 [details]
deleted patch

>### Eclipse Workspace Patch 1.0
>#P org.eclipse.sapphire.osgi.fragment
>patch deleted
Comment 7 Greg Amerson CLA 2011-06-08 16:06:11 EDT
Comment on attachment 197632 [details]
deleted patch

>### Eclipse Workspace Patch 1.0
Comment 8 Konstantin Komissarchik CLA 2011-06-08 18:15:43 EDT
Fixed.
Comment 9 Greg Amerson CLA 2011-06-08 23:16:49 EDT
Verified with build #392
Comment 10 Konstantin Komissarchik CLA 2011-06-08 23:28:33 EDT
Closing.