Bug 88807 - PDE manifest editor incorrectly used to display jar manifests
Summary: PDE manifest editor incorrectly used to display jar manifests
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.1 RC1   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 69640 89385
Blocks:
  Show dependency tree
 
Reported: 2005-03-22 15:54 EST by Steve Nicolai CLA
Modified: 2005-05-17 18:50 EDT (History)
2 users (show)

See Also:


Attachments
patch for org.eclipse.pde (6.90 KB, patch)
2005-05-17 17:45 EDT, Rafael Chaves CLA
no flags Details | Diff
patch for org.eclipse.pde.ui (790 bytes, patch)
2005-05-17 17:46 EDT, Rafael Chaves CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Nicolai CLA 2005-03-22 15:54:22 EST
You can click the little + in front of a jar file in the package explorer and it
will show the contents of a jar file.  On of the standard items in a jar file is
a MANIFEST.MF.

When you open the jar MANIFEST.MF file with eclipse 3.0.1, it uses the PDE
editor to display the content, which does a poor job of displaying the data.

When content-based editor selecting is working, (bug 37668) please update the
PDE editor to use it, so that it will only be used for PDE manifests.
Comment 1 Wassim Melhem CLA 2005-03-29 00:27:07 EST
Even with the new content-based editor lookup, I still don't see how we can 
distinguish between the two MANIFEST.MF files.  They are the same with the 
same format.

RC, how do we resolve this defect?
Comment 2 Rafael Chaves CLA 2005-03-29 12:45:33 EST
One possible solution would be:
- contribute a new content type for bundle manifests (based on JAR Manifest)
that has a pickier content describer (for instance, requires the presence of one
of the common headers specific to bundles to say contents are valid)
- associate the PDE nature to the bundle manifest content type (bug 69640)
- associate PDE editor to the bundle manifest content type

Outcome would be:
- in non-PDE projects (or in runtime libraries), MANIFEST.MF files would be
considered JAR manifests, unless they have some OSGi related header
- in PDE projects, MANIFEST.MF files would always be considered bundle manifests
(due to the nature association).

If you want to go in this direction, this would also require changing the
content describer for JAR manifests to be more precise than it currently is. I
would take care of submitting a patch to JDT/Core.
Comment 3 Wassim Melhem CLA 2005-03-29 13:22:00 EST
I think we should address it yes.

It looks pretty bizzarre when you open a random manifest.mf in the multipage 
editor.

The presence of a Bundle-SymbolicName header as a litmus test would be good.
Comment 4 Rafael Chaves CLA 2005-03-29 13:49:48 EST
Ok, I will take care of implementing the content describers (bug 89385). BTW:
you will have to use the Eclipse-AutoStart header inyour bundle manifest,
because content describers should not trigger auto-activation. A pity that doing
that is not as easy as it used to be. <g>
Comment 5 Wassim Melhem CLA 2005-03-29 13:53:07 EST
by the way, Jeff was cheering me on as I was disposing of the Eclipse-
Autostart section ;-)
Comment 6 Rafael Chaves CLA 2005-05-17 17:45:46 EDT
Created attachment 21299 [details]
patch for org.eclipse.pde
Comment 7 Rafael Chaves CLA 2005-05-17 17:46:18 EDT
Created attachment 21300 [details]
patch for org.eclipse.pde.ui
Comment 8 Rafael Chaves CLA 2005-05-17 17:51:39 EDT
Proposed fix is different from what was originally planned. Only affects PDE/UI. 

org.eclipse.pde provides a bundle manifest content type. This content type
checks the contents of the file looking for some common headers. If one of the
headers exists, PDE's bundle manifest is the content type chosen, otherwise the
plain JAR manifest contributed by org.eclipse.jdt.core wins. PDE's plug-in
manifest is now associated to this new content type instead of to the JAR
manifest content type.

Wassim/Konrad, please review/release if good.
Comment 9 Rafael Chaves CLA 2005-05-17 18:16:35 EDT
See bug 89426 comment 6 for an issue with opening editors for files inside JARs
(only name matching is done)
Comment 10 Wassim Melhem CLA 2005-05-17 18:50:10 EDT
thanks for the patch Rafael.  Plays very well.