Here's one possible use-case for an exclusive lower bound: the current version of a bundle (let's say "1.2.3") contains a feature you need but also a bug which prevents you from using it. There is a bug fix in CVS but the release has not appeared yet containing that fix. You are not aware whether the next release version will be "1.2.4" or "1.2.3.servicepack" or even "1.3". You just know you want the next release after "1.2.3", whatever it will be.

Admittedly this is weak, but still there is no reason not to make the exclusive lower bound available for somebody who wants to use it. As you anticipated, the range (3,4) does include the version "3.0.0.foo". This can easily be tested with the following line of code:

System.out.println(new Version("3.0.0.foo").compareTo(new Version("3")) > 0);

The Version class here is org.osgi.framework.Version from the OSGi core JAR.

Regards,
Neil

On 25 Jul 2008, at 11:11, Fredrik Alströmer wrote:

Hi,

are version ranges (as specified in the core spec R4, 4.1 section 3.2.5) used anywhere but to define requirements (like import-package or require-bundle)? If not, then what is the need for the exclusive lower bound ('(')? I understand that it's included for completeness, but can anyone think an actual use-case where you would want it to be any higher version but NOT a specific one? Wouldn't you always want to make sure that the version you're referencing actually contains what you need, i.e. setting an inclusive lower bound on the version that you want instead of an exclusive at the version below it (although I realize, an unbounded upper limit fails at this point as well)?

It is also clear what [3.0, 4) means, however, what does (3, 4) correspond to? The empty set, or is 3.0.0.foo within this range (which, mathematically, it should be)?

Thanks,
Fredrik.
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev


_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to