Bug 147482 - Import-Package header validation - Extra comma does not result in an error in the manifest edtior
Summary: Import-Package header validation - Extra comma does not result in an error in...
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M3   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday
Depends on:
Blocks:
 
Reported: 2006-06-16 13:06 EDT by Simon Archer CLA
Modified: 2007-10-05 17:03 EDT (History)
4 users (show)

See Also:


Attachments
Screenshot (8.10 KB, image/png)
2007-10-04 09:38 EDT, Curtis Windatt CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Archer CLA 2006-06-16 13:06:19 EDT
Using Eclipse 3.2 RC7

An extra, or dangling, comma in the Import-Package header does not result in an error being reported by the manifest editor.  The Dependencies page of the form-based editor shows no imported packages whatsoever.  It seems that this would be a nice piece of validation to support.

This is an example of an illegal Import-Package header due to the dangling comma:

Import-Package: com.foo,
 com.bar,


And this is an example of an illegal Import-Package header due to the extra comma:

Import-Package: com.foo,,
 com.bar


By comparison, the same problem in the Export-Package header results in the error message "'Export-Package' has invalid format".

Interestingly, when you try and launch Equinox with a bundle with an illegal manifest the "Validate Plug-in Set" button does identify and report the problem.
Comment 1 Simon Archer CLA 2006-06-16 13:20:53 EDT
It seems that a missing comma is also not reported as an error.  The problem is reported by the "Validate Plug-in Set" button from the launch configuration dialog.

This is an example of an illegal Import-Package header due to a missing comma:

Import-Package: com.foo
 com.bar
Comment 2 Chris Aniszczyk CLA 2007-09-05 18:02:39 EDT
Another interesting one Adam, shouldn't be that bad.
Comment 3 Chris Aniszczyk CLA 2007-10-02 16:05:50 EDT
my dream of having a bug open by one "Archer" and closed by another "Archer" have been dashed. Marking this one for bug day ;)
Comment 4 Curtis Windatt CLA 2007-10-03 12:33:53 EDT
I tried this in the manifest editor and errors were reported for both cases after saving the file.  It says that my header has an invalid format.  Works for the Require-Bundle header as well.  Am I missing something or is this working in 3.4?
Comment 5 Chris Aniszczyk CLA 2007-10-03 23:05:21 EDT
(In reply to comment #4)

you sure Curtis? I just tried now and have no errors.
Comment 6 Curtis Windatt CLA 2007-10-04 09:38:39 EDT
Created attachment 79720 [details]
Screenshot

How about you tell me what I'm doing wrong? :)

Screenshot shows the contents of manifest.mf with extra comma's and the error marker showing up.  The full text of the error is "The value of header 'Import-Package' has invalid format".  I get the same thing for problems in the require-bundle header.  The markers show up if I am editing the manifest in the Plug-in Manifest Editor or with a Text Editor.  I get the same result whether I have two commas or a dangling comma, as long as I save the file after any changes.
Comment 7 Brian Bauman CLA 2007-10-04 12:59:12 EDT
Oh no, it seems we have a ghost in someone's machines!  I just tried it on my local machine with I20070920-0936 and it does not give me any errors.  I have no clue what you are doing different Curtis...
Comment 8 Adam Archer CLA 2007-10-05 16:42:35 EDT
I see the errors using I20071002-1342, but I didn't on I20070925-1406.
Comment 9 Brian Bauman CLA 2007-10-05 17:03:13 EDT
Adam, thanks for your help investigating this and figuring out the discrepancy. 

It appears the fix for bug 204614 had an interesting side effect, as in fixing this bug also :)  Talk about two birds with one stone!