You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "I-Ann Chen (JIRA)" <ji...@apache.org> on 2007/10/03 19:49:50 UTC

[jira] Created: (FELIX-389) Allowing for spaces in VersionRange

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


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.


[jira] Commented: (FELIX-389) Allowing for spaces in VersionRange

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Closed: (FELIX-389) Allowing for spaces in VersionRange

Posted by "I-Ann Chen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-389?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

I-Ann Chen closed FELIX-389.
----------------------------


It works. Thank you.

> 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
>            Assignee: Richard S. Hall
>            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.


[jira] Updated: (FELIX-389) Allowing for spaces in VersionRange

Posted by "I-Ann Chen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-389?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

I-Ann Chen updated FELIX-389:
-----------------------------

    Attachment: patch.txt

Suggested fix: strip spaces out of range string. Caveat: Allows malformed ranges (example: [1  .2  .3, 4.5.   6) through.

Minor tangential fix: Removed extra semicolon on line 77 in XmlCommonHandler.

> 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.


[jira] Commented: (FELIX-389) Allowing for spaces in VersionRange

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12532202 ] 

Richard S. Hall commented on FELIX-389:
---------------------------------------

Yeah, I think Felix' approach is better. If you look in:

    org.apache.felix.framework.util.VersionRange

You can see that it actually already does this for the framework's version of this class. Perhaps we should just copy the framework version into OBR?

> 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.


[jira] Resolved: (FELIX-389) Allowing for spaces in VersionRange

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-389?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard S. Hall resolved FELIX-389.
-----------------------------------

    Resolution: Fixed
      Assignee: Richard S. Hall

I updated OBR's VersionRange to be identical to Framework's VersionRange. If this satisfactorily resolves this issue, then please close it.

> 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
>            Assignee: Richard S. Hall
>            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.