I didn’t much like my solution either.  Fortunately we were able to modify the 
bundle that introduced the use of javax.annotation: the javax.annotation import 
was a compile-time dependency, not a runtime dependency.  So all is now well.

Thanks for your feedback!

Brian.

> On 20-Jun-2016, at 3:32 AM, Neil Bartlett <[email protected]> wrote:
> 
> Yes it’s a very common misconception that the Framework always chooses the 
> highest version it can find — I have to address this in every training course 
> I run.
> 
> It *may* prefer the highest version if everything else about the resulting 
> outcomes is equal. But that is an unrealistic assumption, and certainly not 
> something that should be relied upon for proper functioning of your 
> application.
> 
> Neil
> 
>> On 20 Jun 2016, at 08:18, Peter Kriens <[email protected] 
>> <mailto:[email protected]>> wrote:
>> 
>> Note that a version bump does not guarantee that it will be the provider of 
>> the package. The framework can heuristics to do this but these are not 
>> specified to allow optimizations we could not foresee.
>> 
>> Another idea to use is to put the messed up packages on the framework’s 
>> classpath. This will export them from the framework side. Since these are 
>> resolved from the start and the uses constraints match the framework it is 
>> extremely unlikely they are not picked.
>> 
>> You’re in a nice mess …
>> 
>> Kind regards,
>> 
>>      Peter Kriens
>> 
>> 
>>> On 17 jun. 2016, at 23:05, Brian de Alwis <[email protected] 
>>> <mailto:[email protected]>> wrote:
>>> 
>>> On 17-Jun-2016, at 1:08 PM, Neil Bartlett <[email protected] 
>>> <mailto:[email protected]>> wrote:
>>>> If you’re unable to change the bundles then no, not really. The only way 
>>>> is to not install these bundles that have exports of javax.annoation.
>>> 
>>> I ended up following the process we used with hollowing out 
>>> javax.annotation: making a bundle that:
>>> 
>>> includes the other bundles as jars
>>> “Require-Bundle: system.bundle” to pull in the JVM’s javax.annotation 
>>> classes
>>> Import-Package of the various javax.annotation packages in the bundled jars 
>>> in case they’re already around
>>> Export-Package of the various javax.annotation packages in the bundled jars 
>>> with a micro version bump to beat any of the existing jars.
>>> 
>>> That seems to work.
>>> 
>>> Brian.
>>> _______________________________________________
>>> equinox-dev mailing list
>>> [email protected] <mailto:[email protected]>
>>> To change your delivery options, retrieve your password, or unsubscribe 
>>> from this list, visit
>>> https://dev.eclipse.org/mailman/listinfo/equinox-dev 
>>> <https://dev.eclipse.org/mailman/listinfo/equinox-dev>
>> _______________________________________________
>> equinox-dev mailing list
>> [email protected] <mailto:[email protected]>
>> To change your delivery options, retrieve your password, or unsubscribe from 
>> this list, visit
>> https://dev.eclipse.org/mailman/listinfo/equinox-dev
> 
> _______________________________________________
> equinox-dev mailing list
> [email protected]
> To change your delivery options, retrieve your password, or unsubscribe from 
> this list, visit
> https://dev.eclipse.org/mailman/listinfo/equinox-dev

_______________________________________________
equinox-dev mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/equinox-dev

Reply via email to