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] Use Collections.emptyList() rather than Collections.EMPTY_LIST #2916

Closed
justinmclean opened this issue Apr 12, 2024 · 2 comments · Fixed by #2951
Closed

[Improvement] Use Collections.emptyList() rather than Collections.EMPTY_LIST #2916

justinmclean opened this issue Apr 12, 2024 · 2 comments · Fixed by #2951
Assignees
Labels
good first issue Good for newcomers improvement Improvements on everything

Comments

@justinmclean
Copy link
Member

What would you like to be improved?

Use of Collections.EMPTY_LIST can cause ClassCastException exactions at runtime, better to let the compiler catch these sort of issues.

How should we improve?

Fix instances in:
trino-connector/src/main/java/com/datastrato/gravitino/trino/connector/catalog/hive/HiveMetadataAdapter.java
trino-connector/src/main/java/com/datastrato/gravitino/trino/connector/catalog/iceberg/IcebergMetadataAdapter.java

@justinmclean justinmclean added good first issue Good for newcomers improvement Improvements on everything labels Apr 12, 2024
@charliecheng630
Copy link
Contributor

I would like to work on this. :)

yuqi1129 pushed a commit that referenced this issue Apr 15, 2024
…2951)

<!--
1. Title: [#<issue>] <type>(<scope>): <subject>
   Examples:
     - "[#123] feat(operator): support xxx"
     - "[#233] fix: check null before access result in xxx"
     - "[MINOR] refactor: fix typo in variable name"
     - "[MINOR] docs: fix typo in README"
     - "[#255] test: fix flaky test NameOfTheTest"
   Reference: https://www.conventionalcommits.org/en/v1.0.0/
2. If the PR is unfinished, please mark this PR as draft.
-->

### What changes were proposed in this pull request?

Use Collections.emptyList() rather than Collections.EMPTY_LIST

### Why are the changes needed?

Use of Collections.EMPTY_LIST can cause ClassCastException exactions at
runtime, better to let the compiler catch these sort of issues.


Fix: #2916 

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

UT
@jerryshao jerryshao added this to the Gravitino 0.5.0 milestone Apr 15, 2024
@justinmclean
Copy link
Member Author

Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers improvement Improvements on everything
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants