Bug 545604 - Unexplainable Error Markers in Manifest Editor's Import Packages List
Summary: Unexplainable Error Markers in Manifest Editor's Import Packages List
Status: NEW
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: ---   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-20 20:16 EDT by Simon Archer CLA
Modified: 2023-04-25 17:46 EDT (History)
5 users (show)

See Also:


Attachments
Screenshot (62.64 KB, image/png)
2019-03-20 20:17 EDT, Simon Archer CLA
no flags Details
Second screenshot (196.34 KB, image/png)
2019-03-21 09:36 EDT, Simon Archer CLA
no flags Details
Plug-in Explorer Screenshot (182.76 KB, image/png)
2019-03-21 16:08 EDT, Simon Archer CLA
no flags Details
The console log from the Plug-in Explorer. (1.93 MB, text/plain)
2019-03-21 16:17 EDT, Simon Archer 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 2019-03-20 20:16:04 EDT
Opening my Eclipse workspace with the new Eclipse 4.11 release I am seeing a few imported packages decorated with error markers when there is no explainable problem.

I refer you to this New & Noteworthy entry:
  https://www.eclipse.org/eclipse/news/4.11/pde.php#manifest-editor-marker

That N&N entry says, "The Manifest editor's dependency tab now displays error markers for all unsatisfied dependencies."

These are NOT problems, as far as I know. This is code that works, and I can assure you that there are no unsatisfied dependencies.

I believe that this is a bug. At least, it's a bug based on how I'm using the PDE to build OSGi bundles. I shall attach a screen shot.

I shall attempt to reproduce this problem in a test case.
Comment 1 Simon Archer CLA 2019-03-20 20:17:37 EDT
Created attachment 277942 [details]
Screenshot
Comment 2 Vikas Chandra CLA 2019-03-21 02:31:05 EDT
Not sure if related to https://bugs.eclipse.org/bugs/show_bug.cgi?id=511127
Comment 3 Vikas Chandra CLA 2019-03-21 02:32:34 EDT
Julian/Andrey, Is this related to bug 511127?
Comment 4 Andrey Loskutov CLA 2019-03-21 03:58:22 EDT
(In reply to Vikas Chandra from comment #3)
> Julian/Andrey, Is this related to bug 511127?

Most likely yes. I wonder however if the nls package in the screenshot is really missing or not exported or not on the classpath of the declaring bundle, so that the error is *valid* one.
Comment 5 Simon Archer CLA 2019-03-21 09:34:38 EDT
"...if the nls package in the screenshot is really missing or not exported or not on the classpath of the declaring bundle, so that the error is *valid* one."

The nls package:

- Exists.
- Is exported.
- And is on the bundle's .classpath.

I shall attach a screenshot that demonstrates these facts.
Comment 6 Simon Archer CLA 2019-03-21 09:36:30 EDT
Created attachment 277948 [details]
Second screenshot

This screenshot shows that the "com.sas.ct.util.nls" package exists within the "com.sas.ct.util" bundle, that it's an exported package, and that it is on the bundle's .classpath via the "src" <classpathentry>.
Comment 7 Simon Archer CLA 2019-03-21 15:20:09 EDT
I have confirmed that this DOES NOT happen with the following build:

Eclipse SDK
Version: 2018-12 (4.10)
Build id: I20181206-0815
OS: Windows 10, v.10.0, x86_64 / win32
Java version: 1.8.0_102
Comment 8 Andrey Loskutov CLA 2019-03-21 15:34:12 EDT
(In reply to Simon Archer from comment #5)
> "...if the nls package in the screenshot is really missing or not exported
> or not on the classpath of the declaring bundle, so that the error is
> *valid* one."
> 
> The nls package:
> 
> - Exists.
> - Is exported.
> - And is on the bundle's .classpath.
> 
> I shall attach a screenshot that demonstrates these facts.

Simon, may I ask you to install my small Plug-in Dependencies Explorer plugin, here is link to github https://github.com/iloveeclipse/plugindependencies, in the readme is the update site and in the wiki small "how to". 

If you install it, open the Plug-in Dependencies Explorer, select "Running platform" target and check there the packages that are "wrong" in the manifest editor : are there any errors/warnings reported? You can use filter to quickly locate the package/bundle.

I forgot to ask: do you have any errors in the log?
Comment 9 Simon Archer CLA 2019-03-21 15:42:27 EDT
Thanks Andrey, I'll try now. I shall report back.
Comment 10 Simon Archer CLA 2019-03-21 16:08:33 EDT
Created attachment 277952 [details]
Plug-in Explorer Screenshot

In the screenshot I attempted to show you:

- The project "com.sas.ct.app.console" with it Manifest Editor open showing the error marker against the imported package "com.sas.ct.util.nls".

- The project "com.sas.ct.util" that contains, and exports, the package "com.sas.ct.util.nls", which contains a single abstract class named AbstractL10nMessages.

- The Plug-in Explorer view, focused on the project "com.sas.ct.app.console", and drilled down to the Imports and "com.sas.ct.util.nls".
Comment 11 Simon Archer CLA 2019-03-21 16:12:19 EDT
Using the Plug-in Explorer I am unclear why I see so may "Dependency cycle detected" errors.

The architecture of the code has been verify carefully designed to separate interfaces from their implementations. As a result there are few class-to-class couplings. Granted, there are a few packages of classes that are shared with other types, and the package "com.sas.ct.util.nls" is one such package.
Comment 12 Simon Archer CLA 2019-03-21 16:17:00 EDT
Created attachment 277953 [details]
The console log from the Plug-in Explorer.

I am attaching the console log from the Plug-in Explorer with the hope that it provides an overview of my entire Eclipse workspace.
Comment 13 Andrey Loskutov CLA 2019-03-21 16:20:21 EDT
(In reply to Simon Archer from comment #11)
> Using the Plug-in Explorer I am unclear why I see so may "Dependency cycle
> detected" errors.
> 
> The architecture of the code has been verify carefully designed to separate
> interfaces from their implementations. As a result there are few
> class-to-class couplings. Granted, there are a few packages of classes that
> are shared with other types, and the package "com.sas.ct.util.nls" is one
> such package.

The cycles check is a simple one, basically it tries to parse all dependencies including imported packages, recursive, and if on this path the bundle itself appears, I report a cycle. I must confess, I cannot guarantee it is 100% correct, but so far I haven't seen any false positives. It may happen you export same package in multiple bundles or have fragments or some other weird dependencies. Interesting here is: are any warnings/errors reported for the packages itself? What do you mean by "packages that shared with other types"? Are all such packages shown with error markers in manifest editor?
Comment 14 Simon Archer CLA 2019-03-22 16:31:29 EDT
OK, so I have been poking around and trying to find some sort of unholy dependency that I can break to resolve the apparent cycle. I stumbled upon a discovery... The problem is being triggered by the "com.sas.ct.util" project's fragment project "com.sas.ct.util.test", which houses the host's unit tests. Of course the PDE is treating each fragment as an extension to the associated host project, so it seems reasonable for PDE's dependency analysis to include fragments. But keep reading... :-)

But, since fragments are by definition OPTIONAL, it strikes me that including them in static dependency analysis could lead to some false error markers, which is what I believe is happening here.

In my case, I isolated the problem down to the "com.sas.ct.util.test" fragment project importing the package "org.hamcrest", creating a cycle somehow.

When I remove the "org.hamcrest" imported package from the fragment project the error marker on other projects that import packages that have been exported by "com.sas.ct.util" (the host) go away!

In conclusion, I fear that the new Manifest Editor error markers against Imported Packages that was introduced with Eclipse 4.11 is overly aggressive and is producing false-positives.

Also, the Eclipse convention has always been that each error marker has an associated problem shown in the Problems view. This is NOT the case for the new error markers that I'm seeing.

My wish list:

1. Fix the false-positive error markers, although I accept that this might not be possible. But I fear that including fragments in the dependency analysis is the cause of the problem. Unfortunately I was not able to reproduce the problem with a few sample projects.

2. Ensure that every error marker has an associated entry in the Problems view. This, I feel is more than a wish-list item, it's absolutely required by the conventions of the Eclipse Platform.

3. Provide PDE preferences to allow error markers to be changed to Ignore, Warning, or Error, just like many other compiler options.
Comment 15 Julian Honnen CLA 2019-03-25 03:28:37 EDT
The error decorator in the dependencies tab is not supposed to be a new inspection, it should just mirror the existing error markers on the file.

So your case is a false positive. Can you share your projects causing the error (without any Java/source files)?
Comment 16 Andrey Loskutov CLA 2019-04-06 07:20:33 EDT
Simon, is this problem also fixed via bug 545634?
Comment 17 Vikas Chandra CLA 2019-04-08 02:08:44 EDT
>.My wish list:


I suggest you raise new defects for wishlist 2) and wishlist 3). ( with a sample project attached).

This defect will pursue 1).
Comment 18 Eclipse Genie CLA 2021-05-04 16:27:15 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 19 Eclipse Genie CLA 2023-04-25 17:46:34 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.