Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 265431 - [Version] IllegalArgumentException when parsing raw GTEQUAL ranges with format
Summary: [Version] IllegalArgumentException when parsing raw GTEQUAL ranges with format
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.5 M6   Edit
Assignee: P2 Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-19 04:37 EST by Thomas Hallgren CLA
Modified: 2009-02-20 13:46 EST (History)
2 users (show)

See Also:


Attachments
Test that provokes the bug (1.06 KB, patch)
2009-02-19 04:37 EST, Thomas Hallgren CLA
john.arthorne: iplog+
Details | Diff
Patch for the VersionParser that fixes the problem (961 bytes, patch)
2009-02-19 04:39 EST, Thomas Hallgren CLA
john.arthorne: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Hallgren CLA 2009-02-19 04:37:47 EST
Created attachment 126141 [details]
Test that provokes the bug

The VersionRange parser is not able to parse a "raw" version with format and/or original version. Any valid version string passed to the range parser should yield the range ">= version".

A range expressed like this:

  raw:2.1.0.M/format(n[.n=0;[.n=0;]][d?S=M;]):2.1

or

  raw:2.1.0.M/:2.1

results in:

java.lang.IllegalArgumentException: Format "format(r(.r)*p?)" was unable to parse 2.1.0.M/format(n[.n=0;[.n=0;]][d?S=M;]):2.1
 at org.eclipse.equinox.internal.provisional.p2.core.VersionFormat.parse(VersionFormat.java:1214)
 at org.eclipse.equinox.internal.provisional.p2.core.VersionFormat.parseRaw(VersionFormat.java:1049)
 at org.eclipse.equinox.internal.provisional.p2.core.VersionRange.<init>(VersionRange.java:230)
Comment 1 Thomas Hallgren CLA 2009-02-19 04:39:37 EST
Created attachment 126142 [details]
Patch for the VersionParser that fixes the problem
Comment 2 John Arthorne CLA 2009-02-20 13:45:45 EST
Thanks Thomas, patch and test released.