Skip to content

Strange behavior in the editor when a variable is named "va" #9579

Closed

Description

@caschoff

Apache NetBeans version

Apache NetBeans 31

What happened

If you name a variable "va" and format the code a second space appears right of the declaration of "va". If you refactor "va" and delete the additional space, occurrences of "va" at other places in the scope of the code will delete the char right of "va".

Language / Project Type / NetBeans Component

Java Maven Project

How to reproduce

Use this code:

int va = 2;
if (2 == va) {
boolean result = true;
}

Format the Code, look at the declaration of "va", a second space will appear.

Rename "va" with STRG+r, delete the second space, the closing bracket of the if-statement will be deleted.

Did this work correctly in an earlier version?

No / Don't know

Operating System

OSX 26.6.2 (25G83) (Tahoe)

JDK

OpenJDK Runtime Environment Temurin-26.0.2+10 (build 26.0.2+10)

Apache NetBeans packaging

Community provided installer

Anything else

No response

Are you willing to submit a pull request?

No

Activity

  1. added
    kind:bug
    needs:triage
    on Aug 27, 2026
  2. added
    Java
    on Aug 27, 2026
  3. removed
    needs:triage
    on Aug 30, 2026
  4. matthiasblaesing commented on Aug 30, 2026

    @matthiasblaesing
    Contributor

    Verfied

  5. matthiasblaesing commented on Aug 30, 2026

    @matthiasblaesing
    Contributor

    @caschoff please have a look at #9586. That should fix the issue. A nightly build is available from the checks page or directly: https://github.com/apache/netbeans/suites/90301179877/artifacts/9735857919.

  6. added a commit that references this issue on Sep 2, 2026
    e8b4ef2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

EditorJavakind:bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions