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

[Improvement] Remove warnings when compiling Gravitino #4470

Closed
wants to merge 1 commit into from

Conversation

surajguduru
Copy link

Issue: [#1809] Remove Warnings When Compiling Gravitino
Description:

When compiling the Gravitino project, several warnings related to unchecked operations and casts are being produced. These warnings indicate potential issues with type safety and unchecked operations, which can lead to runtime errors or unexpected behavior.

Details:

Location of Warnings:

Multiple occurrences in DTOConverters.java, AuditDTO.java, MetalakeDTO.java, CatalogDTO.java, SchemaDTO.java, ColumnDTO.java, and TableDTO.java.
Examples include unchecked calls to methods and unchecked casts, particularly with raw types and generics.
Impact:

The compiler's -Werror option is set, which treats warnings as errors. This prevents the project from compiling successfully until these warnings are resolved.
Steps to Reproduce:

Compile the Gravitino project with the -Xlint:unchecked option enabled.
Observe the warnings and errors in the compilation output.
Proposed Solution:

Type Safety:

Review and refactor the code to use generics correctly, ensuring type safety and eliminating unchecked operations.
Unchecked Casts:

Correct or suppress unchecked casts where possible, ensuring that the type conversions are safe and valid.
General Code Review:

Conduct a thorough review of the relevant files to ensure compliance with best practices and to resolve any potential issues that might lead to runtime errors.
Additional Information:

Removing these warnings is crucial as per the best practices and will help maintain code quality and reliability.
Related Issues:

None directly related, but fixing these warnings will improve overall code quality and maintainability.

@surajguduru
Copy link
Author

There are some unsuccessful checks, will fix them!!

Copy link
Member

@justinmclean justinmclean left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution. Please leave the existing comments in the code.

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.

2 participants