Bug 374111 - [common navigator][package explorer] problem marker on package should not be repeated on parent package
Summary: [common navigator][package explorer] problem marker on package should not be ...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.8   Edit
Hardware: Other Linux
: P2 normal (vote)
Target Milestone: 3.8 M7   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords: polish
Depends on:
Blocks:
 
Reported: 2012-03-13 13:20 EDT by Stephan Herrmann CLA
Modified: 2012-05-01 04:35 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Herrmann CLA 2012-03-13 13:20:46 EDT
With the fix for bug 372012 a missing @NonNullByDefault on any package (via package-info.java) is reported against the package, good.

However, in the package explorer this marker is rendered twice: for the current package and for the parent package, e.g.:

  bug372012
    package-info.java
  bug372012.p1
    package-info.java
  bug372012.p1.p2

if the default is missing only in bug372012.p1.p2 two warning or error overlays are shown on packages bug372012.p1.p2 *and* bug372012.p1.

This seems to correlate with the fact that problems in any CU are additionally rendered on the containing package, where it makes sense to make problems visible even if packages are shown collapsed. However, for a package propagating the overlay also to the parent is undesired.
Comment 1 Markus Keller CLA 2012-03-13 18:11:19 EDT
Good catch. But this will be a tough one to solve.

ProblemsLabelDecorator#getErrorTicksFromMarkers(..) uses IResource#findMaxProblemSeverity(..) on the package's folder with depth=1. Now, we need to exclude subfolders that are packages.

We have to make sure that the fix doesn't void the performance benefits from bug 177384.

Maybe the fix can also fix a related bug in the decoration of packages:
- create folder "no-pack" with file "build.xml" inside a package
- open build.xml with the Ant editor and paste this line:
    <project name="project">
=> package doesn't show the error decoration, but it should
Comment 2 Markus Keller CLA 2012-04-02 10:27:01 EDT
Fixed both issues with http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=d8af25bc1d18d24931f14543d0010a00d16604da

> We have to make sure that the fix doesn't void the performance benefits from
> bug 177384.

The main benefits were that we avoid creating Marker objects. That's still in. Now, we just have separate calls to IResource#findMaxProblemSeverity(.., DEPTH_ZERO), but the old DEPTH_ONE calls did exactly the same internally.
Comment 3 Dani Megert CLA 2012-05-01 04:35:12 EDT
Verified in I20120430-2000.