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

refact: Use var keyword and List.of and Set.of where applicable #1072

Merged
merged 6 commits into from
Aug 21, 2024

Conversation

sebthom
Copy link
Contributor

@sebthom sebthom commented Aug 20, 2024

Please don't squash this commit when merging for better transparency of the changes.

This PR applies various refactorings to the code base, mainly:

  1. it makes use of the var keyword for local variable assignment where the actual type is immediately recognizable through an implicit cast or a constructor call on the right side of the assignement
  2. Replaces usage of Collections.singletonList and Arrays.asList (if beneficial) with Java 9's List.of
  3. Replaces usage of Collections.sort in places where an unsafe assumption was made that the input list will always be mutable.

replaced explicit types with `var` for local variables where the type is
clear due to the `new` keyword or implicit casting
This commit replaces usage of Collections.sort in places where currently
the unsafe assumption is made that the input list is always mutable.
@rubenporras
Copy link
Contributor

So after Jenkins can validate the PR, we should use "Rebase and Merge"?

@sebthom
Copy link
Contributor Author

sebthom commented Aug 21, 2024

So after Jenkins can validate the PR, we should use "Rebase and Merge"?

yes please. I usually only use squash when the PR contains unpolished commit messages or multiple commits trying to address the exact same issue.

@sebthom sebthom changed the title refact: Use var keyword and List.of where applicable refact: Use var keyword and List.of and Set.of where applicable Aug 21, 2024
@sebthom
Copy link
Contributor Author

sebthom commented Aug 21, 2024

Jenkins CI is down...

@mickaelistria
Copy link
Contributor

Infra failures already reported at https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/4914

@sebthom sebthom merged commit 0b96183 into eclipse-lsp4e:main Aug 21, 2024
6 checks passed
@sebthom sebthom deleted the refact branch August 23, 2024 11:41
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