Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 332886

Summary: Improve Version constructor IllegalArgumentException message
Product: [Eclipse Project] Equinox Reporter: Glyn Normington <glyn.normington>
Component: FrameworkAssignee: equinox.framework-inbox <equinox.framework-inbox>
Status: CLOSED NOT_ECLIPSE QA Contact:
Severity: enhancement    
Priority: P3    
Version: 3.6.1   
Target Milestone: ---   
Hardware: All   
OS: All   
URL: http://www.eclipse.org/forums/index.php?t=rview&goto=645557#msg_645557
Whiteboard:

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!