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

[#2916] Improvement(trino): Improvement on Collections. EMPTY_LIST #2951

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

charliecheng630
Copy link
Contributor

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

Copy link
Contributor

@yuqi1129 yuqi1129 left a comment

Choose a reason for hiding this comment

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

LGTM

@charliecheng630 charliecheng630 changed the title [#2916] Improvement(trino): Intention improvement on Collections. EMPTY_LIST [#2916] Improvement(trino): Improvement on Collections. EMPTY_LIST Apr 15, 2024
@qqqttt123
Copy link
Contributor

Could you add some code style check or error prone this?

@yuqi1129 yuqi1129 merged commit 8d7a2c9 into apache:main Apr 15, 2024
22 checks passed
@justinmclean
Copy link
Member

From a quick look, SonarList and PMD check for this, but not errorprone AFAIK

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.

[Improvement] Use Collections.emptyList() rather than Collections.EMPTY_LIST
4 participants