-
Notifications
You must be signed in to change notification settings - Fork 10
Move "running scans" output message earlier in the execution flow #76
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
Conversation
789a232 to
eca6846
Compare
This change moved the "Running Scans" message much earlier in the execution flow, right after the basic validation but before the heavy operations.
eca6846 to
1351375
Compare
|
@azinneera @keizer619 PRAM |
| outputStream.println(); | ||
| outputStream.println("Running Scans"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| outputStream.println(); | |
| outputStream.println("Running Scans"); | |
| outputStream.println("\nRunning Scans"); |
Better we can add this as a constant variable and use
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix: 801dbf9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SasinduDilshara I think using println() instead of \n is the better approach. The println() method is platform-independent and explicitly terminates the line using the system’s line separator, which is safer than hardcoding \n. As the official Java PrintStream documentation states,
Terminates the current line by writing the line separator string. The line separator string is defined by the system property
line.separator, and is not necessarily a single newline character ('\n').
While \n works on Unix-like systems, it may not represent the correct line ending on Windows or other environments. Using println() also makes the intent to end the line clearer to readers and avoids subtle inconsistencies in cross-platform code, which is why I think it is the better option here.
Updated the output message for running scans to use a constant from ScanToolConstants, improving maintainability and readability of the code.
154d59c to
801dbf9
Compare
scan-command/src/main/java/io/ballerina/scan/internal/ScanToolConstants.java
Outdated
Show resolved
Hide resolved
Updated the constant name for improved clarity and consistency
4a15ac3 to
daa5516
Compare
|



Purpose
Fixes: #75
In the original implementation, it took a considerable amount of time for the 'Running scans' text to appear in the console, because several time-consuming operations were performed beforehand.
Approach
This change moved the "Running Scans" message much earlier in the execution flow, right after the basic validation but before the heavy operations.
Check List