Thanks for reviewing my patch, Karl.

Well, one thing I noticed while looking at your patch is that you are
using java.util.regex*. That part will not make it into the core
because java.util.regex is not available in all of the environments we
target.


Yes, you're right. Which environment should I use during development time in
order to avoid  this kind of mistakes ?

In other words, if you want to foster your case further it might be
helpful to give the patch some more work and get rid of the
java.util.regex dependency...


Well, removing dependencies won't be a lot of stuff. Only R4Library is using
regex patterns, in the 'normalizeOSVersion(...)' method.
But this part of code is not perfect, so it's time to dig deeper ...

In R4, 3.9.1, p.62, first paragraph :
[...] Operator should set the appropriate system property [..] For example,
if the operating system returns version 2.4.2-kwt, the Operator should set
the system property org.osgi.framework.os.version to 2.4.2.

The 'normalizeOSVersion(...)' is only used to normalize the version of the
underlying OS, which you get back reading the value of jvm property '
os.version'. But the standardized org.osgi.framework.Version can only parse
version like major.minor.micro.qualifier, where all but qualifier are int,
and qualifier is text. In other words, I can't call parseVersion(), cause it
won't compute the given example 2.4.2-kwt.

So what should I do :

1/ create a dedicated method in R4Library to make this normalization. That's
what I did, but with a non-compliant implementation. I can easily change it,
but I need precisions to assure compliance.
- What should I return if I can't parse Version ? null, emptyVersion and /
or Exception ?
- To pase the version, I need of course to know the separator between parts
of version. The "." used in Version.parseVersion() is declared as "constant"
but is not visible ? Should I change it, add a new value to FelixConstants,
only use a local definition for separator ? (it's a matter of maintenance
and evolution)

2/ modify org.osgi.framework.Version in order to parse this kind of Version.
I can easily change the parser, but now I can't read the parsed version as
String without qualifier. So I think that I would be doomed to modify the
API of Version, and that's surely unwanted.

Regards,
--
</arnaud>

Reply via email to