Skip to content

Incorrect output in console #4119

Closed
Closed

Description

@pryshrm

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

Activity

  1. added
    kind:bug
    needs:triage
    on May 15, 2022
  2. duoduobingbing commented on May 20, 2022

    @duoduobingbing
    Contributor

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

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

  3. neilcsmith-net commented on May 30, 2022

    @neilcsmith-net
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:bugneeds:triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions