You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Operaxis (Jira)" <ji...@apache.org> on 2020/07/23 00:36:00 UTC

[jira] [Created] (NETBEANS-4617) IDEA-184090 stdout not flushed to console until new line

Operaxis created NETBEANS-4617:
----------------------------------

             Summary: IDEA-184090 stdout not flushed to console until new line 
                 Key: NETBEANS-4617
                 URL: https://issues.apache.org/jira/browse/NETBEANS-4617
             Project: NetBeans
          Issue Type: Bug
          Components: projects - Gradle
    Affects Versions: 12.0
         Environment: Windows 10
            Reporter: Operaxis
            Assignee: Laszlo Kishalmi


Similar (if not completely same) with: [https://github.com/JetBrains/intellij-community/commit/707cf1427f66beb24faa5b8193217e52a8bb85d1] issue. In IntelliJ IDEA case, a fix has been published for version 2020.1. Can be used as reference.

Basically, printf() and print() does not work until a newline, not even System.out.flush() will work. This only happens on Gradle projects, and when running through the IDE (does not happen to Maven/Ant). This does not happen to println() because it prints new line.

Quite a breaking stuff, especially when I'm trying to accept user input on the same line through the console.

As an example to demonstrate the issue:
{code:java}
public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        
        System.out.print("Please enter ABC: ");
        in.next();
        System.out.printf("DEF: ");
        in.next();
        System.out.println("GHI: ");
        in.next();
    }
{code}
Output:
{code:java}
JAVA_HOME="C:\Program Files\AdoptOpenJDK\jdk-14.0.1.7-hotspot"
cd C:\repo\test-cli; ./gradlew --configure-on-demand -PrunClassName=Transaction.Transaction -x check runSingle
Configuration on demand is an incubating feature.
> Task :compileJava UP-TO-DATE
> Task :processResources NO-SOURCE
> Task :classes UP-TO-DATE> Task :runSingle
ABC
DEF
Please enter ABC: DEF: GHI: 
GHI

BUILD SUCCESSFUL in 17s
2 actionable tasks: 1 executed, 1 up-to-date
{code}
A fix would be very appreciated, thank you.

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists