Skip to content

Hint : Value of increment expression is used #9103

@icklesteve

Description

@icklesteve

Apache NetBeans version

Apache NetBeans 28

What happened

The same hint "Value of increment expression is used" is provided whether the expression is ++iD or iD++
I would expect the iD++ hint to display something like "Value is used, then expression incremented."
The ++iD hint could read "Value of incremented expression is used"

Language / Project Type / NetBeans Component

Java Editor Hints

How to reproduce

With a Java class open, Tools > Options > Options Window, Editor Tab, Hints Tab
Language : Java
Assignment Issues : Check Value of increment/decrement expression used

    private int a = 0;
    private final int b = a++;
    private final int c = ++a;

In the source line number column yellow hint warning, the increment tooltip is displayed for both increment and decrement.

Did this work correctly in an earlier version?

No / Don't know

Operating System

Win 11

JDK

openjdk version 21.0.9

Apache NetBeans packaging

Community provided installer

Anything else

Thankyou all for your time contributing to Netbeans !

Are you willing to submit a pull request?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind: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