Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332886 - Improve Version constructor IllegalArgumentException message
Summary: Improve Version constructor IllegalArgumentException message
Status: CLOSED NOT_ECLIPSE
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Framework (show other bugs)
Version: 3.6.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: equinox.framework-inbox CLA
QA Contact:
URL: http://www.eclipse.org/forums/index.p...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-18 05:31 EST by Glyn Normington CLA
Modified: 2010-12-20 09:19 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Glyn Normington CLA 2010-12-18 05:31:19 EST
Invalid version ranges such as [11.2.0.1.0, 11.2.0.1.0] cause the following exception to be thrown:

Caused by: java.lang.IllegalArgumentException: invalid format
at org.osgi.framework.Version.<init>(Version.java:140)
at org.osgi.framework.Version.parseVersion(Version.java:218)
at org.eclipse.virgo.util.osgi.VersionRange.<init>(VersionRange.java:78)
etc.

It would be very helpful to include the version with the invalid format in the exception message to ease diagnosis.
Comment 1 Glyn Normington CLA 2010-12-18 05:33:28 EST
See the URL for this bug for an example of where the diagnostics could have helped.
Comment 2 BJ Hargrave CLA 2010-12-18 08:51:44 EST
Don't you think this is a bug for OSGi since Version is a class defined by OSGi?
Comment 3 Glyn Normington CLA 2010-12-20 03:51:26 EST
Perhaps, but I thought the exception message was an implementation detail rather than something that should be spec'd.
Comment 4 BJ Hargrave CLA 2010-12-20 08:44:23 EST
Equinox just uses the Version class (and other OSGi classes) as it comes from OSGi and does not make any modifications.
Comment 5 Glyn Normington CLA 2010-12-20 09:19:12 EST
I see. Raised OSGi bug.
Comment 6 Glyn Normington CLA 2010-12-20 09:19:59 EST
And thanks for the advice BJ!