Skip to content

EnhancedJavaRendering: WebJavaLabelProvider returns null for IJavaElement nodes and has no-op listener methods, breaking error/warning overlays in any viewer that inherits Project Explorer bindings #42

Description

@vinumolkp-1

Observed symptom
In any viewer inheriting Project Explorer bindings (e.g. WDT Enterprise Explorer), IPackageFragmentRoot, IPackageFragment, and ICompilationUnit nodes have no icon at all — neither a base image nor an error/warning overlay — when compilation errors exist in the project.

Root cause
WebJavaLabelProvider.getImage(Object element) checks element instanceof ICompressedNode at the top of the method. For all other elements — including every raw IJavaElement such as IPackageFragmentRoot, IPackageFragment, and ICompilationUnit — the method returns null.

The Common Navigator label pipeline stops at the first non-null result. When WebJavaLabelProvider is the active overriding provider and returns null, the pipeline produces no image for those nodes.

Decompiled from org.eclipse.jst.servlet.ui_1.2.300.v202502280419.jar → org/eclipse/jst/servlet/ui/internal/navigator/WebJavaLabelProvider.class
getImage() returns null for any element that is not an ICompressedNode. No delegation to JavaElementLabelProvider or ProblemsLabelDecorator occurs for child nodes.

Expected behaviour
getImage() should, for IJavaElement elements, delegate to JavaElementLabelProvider for the base icon and then apply ProblemsLabelDecorator.decorateImage() so that error/warning overlays are shown — the same behaviour that existed in WTP 1.1.x via org.eclipse.jdt.java.ui.javaContent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions