Skip to content

Conversation

@tobiasmelcher
Copy link
Contributor

@tobiasmelcher tobiasmelcher commented Jan 20, 2026

This PR fixes a NullPointerException that currently interrupts the code‑mining rendering pipeline. Due to this exception being thrown during editor initialization, no code minings are displayed when the editor is opened.

The problem is fixed by adding a null check for the support field in method call AbstractInlinedAnnotation.isInVisibleLines().

Add a null check for the `support` field in the
`AbstractInlinedAnnotation` class to prevent `NullPointerException` when
the `isInVisibleLines` method is called. This issue occurs because
`support` may not be initialized when the editor is first opened,
causing code minings to not render initially.
@github-actions
Copy link
Contributor

Test Results

 3 018 files  ±0   3 018 suites  ±0   2h 16m 41s ⏱️ - 13m 13s
 8 270 tests ±0   8 022 ✅ ±0  248 💤 ±0  0 ❌ ±0 
23 634 runs  ±0  22 843 ✅ ±0  791 💤 ±0  0 ❌ ±0 

Results for commit a81721f. ± Comparison against base commit 62f3974.

@vogella
Copy link
Contributor

vogella commented Jan 20, 2026

Should viewer in the constructor maybe also assigned to fViewer? Without knowing to much about the code, it looks weird to me that viewer is passed to the constructor but ignored. Could that result in another NPE?

Suggested fix:

protected AbstractInlinedAnnotation(Position position, ISourceViewer viewer, ...) {
            super(TYPE, false, "");
           this.position = position;
           this.fViewer = viewer; // NEW NEW
            // ...
     }
 

@iloveeclipse iloveeclipse requested a review from Copilot January 20, 2026 19:24
@iloveeclipse
Copy link
Member

This PR fixes a NullPointerException that currently interrupts the code‑mining rendering pipeline

Steps to reproduce?

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a NullPointerException that prevents code minings from being displayed when an editor is initially opened. The issue occurs when isInVisibleLines() is called before the support field has been initialized via setSupport().

Changes:

  • Added null checks for the support field in both overloaded isInVisibleLines() methods
  • Returns true optimistically when support is not yet available, allowing annotations to be rendered during editor initialization

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants