Community
Participate
Working Groups
Build Identifier: 3.7.0 The code is doing a compare of the String value of the versions. It should be comparing the Version objects. The first three components of a version are non-negative integers and must be compared as such. Our plug-ins have moved on to a minor version of 10 and the target definition is resolving to an older version, causing chaos in our development team. A patch is attached. I would have prefered to add getOsgiVersion/setOsgiVersion to BundleInfo and deprecated the getVersion/setVersion methods. The author of this comparator is PDE probably assumed getVersion was returning the Version object so this change to BundleInfo would help avoid this error. However that would involve another patch for the Equinox team so may not be worth doing. I considered catching the IllegalArgumentException and falling back to the string compare, just to make sure that we don't break anyone who might have some invalid version strings out there. However I think such users would have other problems so giving them an exception is beter. Reproducible: Always
Created attachment 204368 [details] patch to use correct version comparisons
We are working at converting the target code from provisional to a real API (bug 347695). We will make this change once that fix has been committed. Thanks for the patch.
Target API is waiting for M4
Applied the fix, but added a catch for the illegal argument exception (logs the error). While it is true that the user will have other problems with target bundles, an uncaught exception will not be handled nicely. http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=9568a385e731ab3a727589517dc697262e936ba8
Verified