netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

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

Open caschoff opened this issue 3 months ago • 2 comments

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

caschoff avatar Aug 27 '26 09:08 caschoff

Verfied

matthiasblaesing avatar Aug 30 '26 16:08 matthiasblaesing

@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.

matthiasblaesing avatar Aug 30 '26 17:08 matthiasblaesing