Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Meaning of Error Squiggles in VSCode Java

My java code has these error squiggles. What do they mean and how do I disable them?

Error Squiggles Java

Mouse Over Drop Down 1

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Mouse Over Drop Down 2

What do these mean? What does the software suggest me to do?

PS: I’m a complete newb

>Solution :

Hints, no error. For proposing code changes, and SonarLint: code style warnings.

Here it suggests (wrongly so) to replace System.out by a shorter final PrintWriter, say out, so you need only to use out.println(...). That is not normally done.

But a similar rule states that one should use a Logger instead.

For the main: new Hello().execute(); and then in a separate non-static method (execute) do the code you wrote in main.


SonarLint: code style checker, named after the C lint tool to find "lint" in the code, dubious code pieces, like unitialized variables, dangerous lossy conversions and such.


Writing to System.out (the console) is not good style in a web server or a GUI desktop application, hence the advice is to use a Logger for logging interesting information, possibly to the console, but also possibly to a log file.

You should especially as a beginner not disable the linting extension.
Ignore the squiggles, only from time to time look at them.
One can also disable specific SonarLint rules one finds dumb.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading