Bug 545634 - Manifest Editor Incorrectly Sees Java Package as a Non-Java Package
Summary: Manifest Editor Incorrectly Sees Java Package as a Non-Java Package
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.11   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: 4.12 M1   Edit
Assignee: Vikas Chandra CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-21 09:42 EDT by Simon Archer CLA
Modified: 2019-04-09 00:19 EDT (History)
3 users (show)

See Also:


Attachments
Screenshot (150.51 KB, image/png)
2019-03-21 09:43 EDT, Simon Archer CLA
no flags Details
Screenshot showing how to reproduce the bug. (33.08 KB, image/png)
2019-03-22 11:03 EDT, Simon Archer CLA
no flags Details
Sample project that demonstrates the bug. (2.61 KB, application/x-zip-compressed)
2019-03-22 11:06 EDT, Simon Archer CLA
no flags Details
Tentative fix (1.15 KB, patch)
2019-03-22 12:27 EDT, Vikas Chandra CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Archer CLA 2019-03-21 09:42:43 EDT
Having stepped up to Eclipse 4.11 it appears that the Manifest Editor does not recognize all Java packages. 

When I turn to the "Runtime" page of the Manifest Editor and attempt to add a Java package to the Exported Packages list the resulting dialog DOES NOT include my Java package "com.sas.dt.internal.app.common.nls".

ONLY when I check the "Show non-Java packages" does my Java package get included in the dialog's list of packages to export.

I shall attach a screen shot that shows:

 - That the package is indeed a Java package.
 - That the dialog does not include the Java package.
 - That when I check "Show non-Java packages" the Java package is shown.
Comment 1 Simon Archer CLA 2019-03-21 09:43:18 EDT
Created attachment 277950 [details]
Screenshot
Comment 2 Andrey Loskutov CLA 2019-03-21 09:48:45 EDT
Looking at your picture and also at bug 545604 I wonder if you have autobuild turned off or if your workspace is somehow out-of-sync with the file system, or your platform itself contains the bundles you have in the workspace but with different content?
Comment 3 Simon Archer CLA 2019-03-21 11:41:36 EDT
Thanks Andrey...

- Auto build is ON.
- The workspace is not out-of-sync with the file system.
- I am not using a custom PDE platform/target.

I am using Eclipse to build a pure OSGi-based application, not a collection of Eclipse plug-ins. While I understand that an Eclipse plug-in IS an OSGi bundle, the opposite is not always true.

Background: I'm *very* experienced with using Eclipse's PDE for building plug-in projects, regardless of whether they're Eclipse IDE/RCP plug-ins, or OSGi bundles, having used Eclipse since before version 1.0, and OSGi since its initial specification release.

The codebase I'm working on has existed for over 5 years, and is very well tested and understood. So the likelihood is that I'm highlighting genuine bugs in Eclipse PDE.

Thanks!
Comment 4 Vikas Chandra CLA 2019-03-22 02:10:13 EDT
>. I'm highlighting genuine bugs in Eclipse PDE.

Looks like a bug in PDE.



I tried on few sample projects and it works fine.  The only time a package is not seen there is when it has only .properties file or something like that. Once a java file is present, this should not happen at all.

Would it be possible for you to create this issue by attaching a sample project where this bug is exhibited?
Comment 5 Simon Archer CLA 2019-03-22 09:11:27 EDT
I can certainly try. Thanks.
Comment 6 Simon Archer CLA 2019-03-22 11:02:58 EDT
I have successfully reproduced the bug!

The bug is that when you have a Java package named the same as a non-Java package in another source folder, such as under "resources" (which is very common for storing bundle resources such as externalized strings), the Export Package dialog incorrectly filters out the package.

- I shall attach a screen shot.
- I shall attach a zip containing a sample project.
Comment 7 Simon Archer CLA 2019-03-22 11:03:26 EDT
Created attachment 277966 [details]
Screenshot showing how to reproduce the bug.
Comment 8 Simon Archer CLA 2019-03-22 11:06:26 EDT
Created attachment 277967 [details]
Sample project that demonstrates the bug.
Comment 9 Vikas Chandra CLA 2019-03-22 12:27:28 EDT
Created attachment 277968 [details]
Tentative fix
Comment 10 Simon Archer CLA 2019-03-22 12:56:36 EDT
Thanks Vikas for addressing this issue.
Comment 11 Dani Megert CLA 2019-03-22 13:00:45 EDT
(In reply to Vikas Chandra from comment #9)
> Created attachment 277968 [details] [diff]
> Tentative fix
Please use Gerrit as usual.
Comment 12 Eclipse Genie CLA 2019-03-25 00:36:19 EDT
New Gerrit change created: https://git.eclipse.org/r/139394
Comment 14 Vikas Chandra CLA 2019-04-09 00:19:24 EDT
verified in
Version: 2019-06 (4.12)
Build id: I20190406-1800