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

ASCII/UNICODE BUG K=75 #4017

Closed
ghost opened this issue Apr 22, 2022 · 16 comments · Fixed by #4954
Closed

ASCII/UNICODE BUG K=75 #4017

ghost opened this issue Apr 22, 2022 · 16 comments · Fixed by #4954
Labels
kind:bug Bug report or fix os:windows

Comments

@ghost
Copy link

ghost commented Apr 22, 2022

Apache NetBeans version

verified in 14rc4, 13... 12.0

What happened

for (int i=0; i<=127; i++){
    System.out.println(i + " " + (char) i);
} 

I was running this code above and received the following output:
(I was missing the value 75 of uppercase K) (Netbeans IDE version 12.6)
bugasiiunicode

How to reproduce

see above

Did this work correctly in an earlier version?

No

Operating System

Windows

JDK

17.0.1

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

No response

Are you willing to submit a pull request?

Yes

Code of Conduct

Yes

@ghost ghost added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Apr 22, 2022
@sadhusreenivas
Copy link

Oh...nice find.

Its working in other editors properly (Sublime)

75 - K is not getting printed!
Nice bug....kudos!

@lkishalmi
Copy link
Contributor

Could not reproduce on Linux. What happens if the i=64 ?

@00816
Copy link

00816 commented May 17, 2022

It actually missing 75.

@lkishalmi
Copy link
Contributor

I know, but from 0-31 there are control characters which could affect the output.
Also the complete line 75 is missing, not just the K. If a line is missing it might be a synchronization issue or some buffering issue between the OS process and NetBeans.

@lkishalmi
Copy link
Contributor

Maybe related to #4119

@00816
Copy link

00816 commented May 17, 2022

This issue is only Netbeans 12.6. All other versions, its working fine.

This has been produced on Windows.

Console and other text editors, it could able to print that line.

I amazed why 75 - K is missing, every time.

Is that a bug? how to understand.

@mbien
Copy link
Member

mbien commented May 18, 2022

the screenshots shows 12.6 but the issue had "latest daily build" selected. Someone please test NetBeans 13 and 14rc4 so that we know that this is in fact not already fixed, e.g via #3289 or #3836

@duoduobingbing
Copy link
Contributor

duoduobingbing commented May 20, 2022

the screenshots shows 12.6 but the issue had "latest daily build" selected. Someone please test NetBeans 13 and 14rc4 so that we know that this is in fact not already fixed, e.g via #3289 or #3836

I haved test this for Netbeans 13 + Java 17.0.3 under Windows 10
when having system variable MAVEN_OPTS=-Dfile.encoding=UTF-8 set:

The Code

public static class Main{
 public static void main(String args[]) throws Exception {
        
        System.out.println(75 + " " + (char)75);
        System.out.println((char)75);   
        System.out.println(Charset.defaultCharset());

    }
}

when executing a Maven project yields

K
UTF-8

in the Netbeans Console.

The line 75 K is always missing.

@lkishalmi
Copy link
Contributor

lkishalmi commented May 20, 2022

Still works on Linux either with Ant or Maven project.

@duoduobingbing
Copy link
Contributor

duoduobingbing commented May 20, 2022

After some further testing it seems like any String of the pattern ^\d+ ?K$ is swallowed by the Netbeans console under Windows.

System.out.println("5000K");  //output missing
System.out.println("" + "204K");  //output missing
System.out.println("" + "255 K");  //output missing
System.out.println("" + "K");  //does show

@mbien
Copy link
Member

mbien commented May 20, 2022

i tested 14rc4 and 12.0 on win 10 and saw the same issue in both cases. This means this is not a recent regression, its an older issue which is not influenced by recent changes in encoding related code.

going to update the issue details a bit

@mbien mbien removed the needs:triage Requires attention from one of the committers label May 20, 2022
@lbruun
Copy link
Contributor

lbruun commented May 29, 2022

Using Windows 11, NB 13 and JDK 11, I can only reproduce on a Maven-based project, not on a Ant-based one.
My full and complete application is this:

public class MyMain {
   public static void main(String[] args) {
        System.out.println("Start");
        System.out.println("75 " + (char) 75);  // Swallowed with NB-->Maven execution
        System.out.println("End");
    }
}

However, when executing the mvn command line which NB constructs outside of the IDE in the cmd.exe, then I do indeed get the line printed correctly. Baffled. Regardless I'm thinking it may have to do with Maven ANSI coloring, Maven's use of jansi and how all that plays with NetBeans ?

@lbruun
Copy link
Contributor

lbruun commented May 29, 2022

I've done some debugging. Nothing to do with ANSI coloring and what not. Sorry for bringing that up.

The text 75 K by coincidence matches what the NetBeans Maven CommandLineOutputHandler seems to think is download progress info from Maven. It is obviously not.

The output is skipped for this reason. So there you have it.

The class, CommandLineOutputHandler, does a lot of pattern matching on the output from Maven before it presents it in the Output window. Too much for my taste, but I understand why it may be necessary.

Not sure what the fix is.

@mbien
Copy link
Member

mbien commented May 29, 2022

@lbruun thank you for investigating. I was actually curious how many comments this issue will get before someone starts a debugger :)

@neilcsmith-net
Copy link
Member

@lbruun nice find! And comment at line 319 shows this was picked up before in https://bz.apache.org/netbeans/show_bug.cgi?id=252514 .. and probably why this is a Windows bug given the guard on \r.

I was curious why 63 ? and 66 B were getting through, until I looked at the screenshot again! 😄

@mbien
Copy link
Member

mbien commented May 31, 2022

the download progress filter doesn't work anymore, right?
I typically see output like:

Progress (1): 2.7/746 kB
Progress (1): 5.5/746 kB
Progress (1): 8.2/746 kB
Progress (1): 11/746 kB 
Progress (1): 14/746 kB
Progress (1): 16/746 kB
Progress (1): 19/746 kB
Progress (1): 21/746 kB
Progress (1): 24/746 kB
Progress (1): 27/746 kB
Progress (2): 27/746 kB | 0/2.5 M
...

which would be one constantly updating line in a shell.

I am wondering if we can just drop the filter. Maven has -ntp (--no-transfer-progress) which might not have existed back when this was written.

mbien added a commit to mbien/netbeans that referenced this issue Nov 9, 2022
 - sets --no-transfer-progress as default global maven option
 - removes console regexp filter which fixes apache#4017
 - regexp filter didn't work with current maven anyway
Chris2011 pushed a commit to Chris2011/netbeans that referenced this issue Dec 15, 2022
 - sets --no-transfer-progress as default global maven option
 - removes console regexp filter which fixes apache#4017
 - regexp filter didn't work with current maven anyway
pepness pushed a commit to pepness/incubator-netbeans that referenced this issue Jan 9, 2023
 - sets --no-transfer-progress as default global maven option
 - removes console regexp filter which fixes apache#4017
 - regexp filter didn't work with current maven anyway
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 os:windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants