Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 266887 - [Version] Versions created with NULL or an empty string yields NPE when used
Summary: [Version] Versions created with NULL or an empty string yields NPE when used
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-03-03 11:45 EST by Thomas Hallgren CLA
Modified: 2009-03-03 23:39 EST (History)
0 users

See Also:


Attachments
Testcase that provokes the NPE (989 bytes, patch)
2009-03-03 11:46 EST, Thomas Hallgren CLA
john.arthorne: iplog+
Details | Diff
New Version.java with improved String constructor (13.72 KB, text/plain)
2009-03-03 11:57 EST, Thomas Hallgren CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Hallgren CLA 2009-03-03 11:45:35 EST
A version that is created with an empty string or NULL results in an instance that does not have a vector if created using the Version(String) constructor. Subsequent usage of this version yields NullPointerExceptions.

Version v = Version.parseVersion(""); // OK
Version v = new Version(""); // Not OK
Comment 1 Thomas Hallgren CLA 2009-03-03 11:46:26 EST
Created attachment 127339 [details]
Testcase that provokes the NPE
Comment 2 Thomas Hallgren CLA 2009-03-03 11:57:20 EST
Created attachment 127340 [details]
New Version.java with improved String constructor

This attachment is the full Version.java file, fix included. It is not a patch. The reason is that the current HEAD of Version.java is in old Mac format (just CR's and no NL's) so a patch cannot be created/applied. Please *replace* the old file with this one. A copy paste into an editor is likely to preserve the old format.
Comment 3 John Arthorne CLA 2009-03-03 23:35:54 EST
Fix released. I noticed this test also wasn't part of the main test suite, so I added it to the AllTests for the omniversion package.

I did replace the whole file as you requested, but can you also attach a patch form of the change to Version.java so I can mark it for IP log purposes?