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

Checkstyle for System.out.println or Exception::printStackTrace() #3991

Merged
merged 1 commit into from
Jan 23, 2024

Conversation

dlvenable
Copy link
Member

Description

Adds two new Checkstyle checks:

  • Disallow System.out.println
  • Disallow .printStackTrace()

This includes an exception for the stdout sink which must call System.out.println.

There were several occurrence of both and this PR includes checks for these.

Issues Resolved

N/A

Check List

  • New functionality includes testing.
  • New functionality has a documentation issue. Please link to it in this PR.
    • New functionality has javadoc added
  • Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

… used. Removed usage of those two in our main code and tests.

Signed-off-by: David Venable <[email protected]>
@@ -571,15 +574,15 @@ private List<Map<String, Object>> createParquetRecordsList(final InputStream inp
try {
eventData.put(field.getName(), simpleGroup.getValueToString(fieldIndex, 0));
} catch (Exception parquetException) {
parquetException.printStackTrace();
LOG.error("Failed to parse Parquet", parquetException);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These exceptions are being thrown, so for now I'm logging the error.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created #3992 to track this possible bug.

Copy link
Member

@graytaylor0 graytaylor0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good change thanks!

@dlvenable dlvenable merged commit ac673c5 into opensearch-project:main Jan 23, 2024
49 of 50 checks passed
@dlvenable dlvenable deleted the checkstyle-prints branch January 23, 2024 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants