Skip to content

Alt enter hotkey duplicates error messages causing persistent red underlines #8772

@wolftxt

Description

@wolftxt

Apache NetBeans version

Apache NetBeans 28 latest daily build

What happened

Using alt + enter while netbeans is still analyzing the source code (right after a change) causes the error message to duplicate. When that issue is fixed with alt + enter, because the message was duplicated, the error message remains and the line still has a red underline.
https://github.com/user-attachments/assets/41b70a41-e83d-41d8-8128-3a6c4838cd5c

Language / Project Type / NetBeans Component

Works with any java project

How to reproduce

Write this line without importing Map or HashMap. Map<String, String> hashMap = new HashMap(); Use alt + enter to import and quickly press alt + enter again, the error message for the second import will be duplicated. Also works with other bugs like a missing semicolon.

Did this work correctly in an earlier version?

No / Don't know

Operating System

macOS Sequioa 15.2

JDK

24.0.1

Apache NetBeans packaging

Own source build

Anything else

The bug is present both in Netbeans 26 binary zip and in own source build.

Are you willing to submit a pull request?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Java[ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form)hintskind:bugBug report or fixneeds:triageRequires attention from one of the committers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions