Skip to content

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

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

Metadata

Metadata

Labels

EditorJava[ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form)kind:bugBug report or fix

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions