[ 
https://issues.apache.org/jira/browse/FELIX-389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12532183
 ] 

Felix Meschberger commented on FELIX-389:
-----------------------------------------

The proposed fix requires Java 1.4. Not sure, whether this is acceptable ?

Another less intrusive fix would be to trim the vlo and vhi parts of the ranges 
as in:


Index: 
/usr/src/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/VersionRange.java
===================================================================
--- 
/usr/src/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/VersionRange.java
     (revision 578132)
+++ 
/usr/src/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/VersionRange.java
     (working copy)
@@ -84,8 +84,8 @@
         if (range.indexOf(',') >= 0)
         {
             String s = range.substring(1, range.length() - 1);
-            String vlo = s.substring(0, s.indexOf(','));
-            String vhi = s.substring(s.indexOf(',') + 1, s.length());
+            String vlo = s.substring(0, s.indexOf(',')).trim();
+            String vhi = s.substring(s.indexOf(',') + 1, s.length()).trim();
             return new VersionRange (
                 new Version(vlo), (range.charAt(0) == '['),
                 new Version(vhi), (range.charAt(range.length() - 1) == ']'));


> Allowing for spaces in VersionRange
> -----------------------------------
>
>                 Key: FELIX-389
>                 URL: https://issues.apache.org/jira/browse/FELIX-389
>             Project: Felix
>          Issue Type: Bug
>          Components: Bundle Repository (OBR)
>    Affects Versions: 1.0.0
>         Environment: WinXP, Java 6
>            Reporter: I-Ann Chen
>            Priority: Minor
>         Attachments: patch.txt
>
>
> VersionRange.java is not allowing for spaces in the version range (example: 
> [1.2.3, 4.5.6] will throw a NumberFormatException because it tries to parse " 
> 4").

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to