Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting Issue - Wrapping for Java 21 Style Switch Cases that have Arrows #7326

Open
mrj760 opened this issue Apr 23, 2024 · 0 comments
Open
Labels
Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) kind:bug Bug report or fix

Comments

@mrj760
Copy link

mrj760 commented Apr 23, 2024

Apache NetBeans version

Apache NetBeans 21

What happened

Issue with Options -> Formatting -> Java -> Wrapping.
Options set to....
Case Statements: Never
Lambda Arrow: Never

Yet when using auto-format on the following, it turns into the next example.

var foo = switch(type) {
    case NORTH -> "Santa Claus";
    case SOUTH -> "Scientist";
    default -> "Agent Smith";
}

Turns to:

var foo = switch(type) {
    case NORTH -> 
        "Santa Claus";
    case SOUTH -> 
        "Scientist";
    default -> 
        "Agent Smith";
}

Language / Project Type / NetBeans Component

Java Maven Project

How to reproduce

image

Did this work correctly in an earlier version?

No / Don't know

Operating System

Windows 10

JDK

jdk-21

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

No response

Are you willing to submit a pull request?

No

@mrj760 mrj760 added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Apr 23, 2024
@mbien mbien added Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) and removed needs:triage Requires attention from one of the committers labels Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) kind:bug Bug report or fix
Projects
None yet
Development

No branches or pull requests

2 participants