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] In MetricsSystem.java use LinkedList #2163

Closed
justinmclean opened this issue Feb 9, 2024 · 0 comments · Fixed by #2203
Closed

[Improvement] In MetricsSystem.java use LinkedList #2163

justinmclean opened this issue Feb 9, 2024 · 0 comments · Fixed by #2203
Labels
good first issue Good for newcomers improvement Improvements on everything

Comments

@justinmclean
Copy link
Member

What would you like to be improved?

MetricsSystem.java:38: warning: [JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.
private List metricsReporters = new LinkedList<>();

See https://errorprone.info/bugpattern/JdkObsolete)

How should we improve?

No response

@justinmclean justinmclean added good first issue Good for newcomers improvement Improvements on everything labels Feb 9, 2024
henrybear327 added a commit to henrybear327/gravitino that referenced this issue Feb 14, 2024
henrybear327 added a commit to henrybear327/gravitino that referenced this issue Feb 14, 2024
Replace LinkedList with ArrayList
henrybear327 added a commit to henrybear327/gravitino that referenced this issue Feb 15, 2024
Replace LinkedList with ArrayList
FANNG1 pushed a commit that referenced this issue Feb 16, 2024
<!--
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?

Replace LinkedList with ArrayList.

### Why are the changes needed?

Address linter issues mentioned in #2163.

Fix #2163

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

No.

### How was this patch tested?

Covered by existing tests.
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.

1 participant