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

Bug 348795

Summary: sapphire-extension.xml can be found multiple times by ExtensionsLocatorFactory due to buddy classloading
Product: z_Archived Reporter: Greg Amerson <gregory.amerson>
Component: SapphireAssignee: Konstantin Komissarchik <konstantin>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: konstantin
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
deleted patch none

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.