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

Incorrect output in console #4119

Closed
pryshrm opened this issue May 15, 2022 · 2 comments
Closed

Incorrect output in console #4119

pryshrm opened this issue May 15, 2022 · 2 comments
Labels
kind:bug Bug report or fix needs:triage Requires attention from one of the committers

Comments

@pryshrm
Copy link

pryshrm commented May 15, 2022

Apache NetBeans version

Apache NetBeans 13

What happened

I have a simple test program and when I run it in Netbeans IDE 13 using JDK 17, the output window shows the following output.
Code:

public class TestClass {
    public static void main(String[] args) {
        double amount = 200_00.00;
        NumberFormat nf2 = NumberFormat.getCompactNumberInstance(Locale.US, Style.SHORT);
        String s = nf2.format(amount);
        System.out.println("yyy"+s);
        System.out.println(s);  //where is the output for this???
        System.out.println("xxx"+s);
    }
}

Netbeans Output:

yyy20K
xxx20K

When I run the same program on command line using the same JDK, I get the following output:
Output on command prompt:

yyy20K
20K
xxx20K

As you can see, the middle line is missing in the output shown by Netbeans.

Product Version: Apache NetBeans IDE 13
Java: 17.0.3; Java HotSpot(TM) 64-Bit Server VM 17.0.3+8-LTS-111
Runtime: Java(TM) SE Runtime Environment 17.0.3+8-LTS-111
System: Windows 10 version 10.0 running on amd64; Cp1252; en_IN (nb)
User directory: C:\Users\CEO\AppData\Roaming\NetBeans\13
Cache directory: C:\Users\PRYSHRM\AppData\Local\NetBeans\Cache\13

How to reproduce

Run this code and see the output:

public class TestClass {
    public static void main(String[] args) {
        double amount = 200_00.00;
        NumberFormat nf2 = NumberFormat.getCompactNumberInstance(Locale.US, Style.SHORT);
        String s = nf2.format(amount);
        System.out.println("yyy"+s);
        System.out.println(s);  //where is the output for this???
        System.out.println("xxx"+s);
    }
}

Did this work correctly in an earlier version?

No

Operating System

Windows

JDK

17

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

No response

Are you willing to submit a pull request?

No

Code of Conduct

Yes

@pryshrm pryshrm added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels May 15, 2022
@duoduobingbing
Copy link
Contributor

Can confirm. The line System.out.println(s); is not printed.

Combination: Windows 10 + Maven Project + Eclipse Adoptium JDK 17.0.3

@neilcsmith-net
Copy link
Member

Closing as duplicate of #4017 - thanks for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug Bug report or fix needs:triage Requires attention from one of the committers
Projects
None yet
Development

No branches or pull requests

3 participants