Skip to content

Formatting alters content #8483

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

Open
naren2605 opened this issue May 5, 2025 · 1 comment · May be fixed by #8484
Open

Formatting alters content #8483

naren2605 opened this issue May 5, 2025 · 1 comment · May be fixed by #8484
Labels
Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) kind:bug Bug report or fix

Comments

@naren2605
Copy link
Contributor

naren2605 commented May 5, 2025

Apache NetBeans version

Apache NetBeans 25

What happened

formatter is altering content as pointed in jvsce-issue

attaching additional cases for reference

Image

Language / Project Type / NetBeans Component

No response

How to reproduce

open java file sample as below and format document

/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 */

package com.mycompany.formatting.issue;

/**
 *
 * @author nbalyamm
 */
public class FormattingIssue {

    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
    
    public void case1(){
        if ("foo".contains("bar"))))) )))  {
                                System.out.println("bar");
                    }
        
    }
    
    public void case2(){
        
        if ("foo".contains("bar"))))) )))
        
    }
    
    public void case3(){
        if ("foo".contains("bar"))))) ))) 
                 else {
                       System.out.println("bar2")
                    }
    }
}

Did this work correctly in an earlier version?

No / Don't know

Operating System

macos

JDK

jdk24

Apache NetBeans packaging

Apache NetBeans platform

Anything else

No response

Are you willing to submit a pull request?

Yes

@naren2605 naren2605 added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels May 5, 2025
@naren2605 naren2605 linked a pull request May 5, 2025 that will close this issue
@naren2605
Copy link
Contributor Author

requesting @jlahoda , @mbien @dbalek to take a look

@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 May 5, 2025
@mbien mbien linked a pull request May 5, 2025 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants