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

Apply "silent code cleanup" from IntelliJ #3755

Merged
merged 4 commits into from
Oct 26, 2023
Merged

Apply "silent code cleanup" from IntelliJ #3755

merged 4 commits into from
Oct 26, 2023

Conversation

Baltoli
Copy link
Contributor

@Baltoli Baltoli commented Oct 25, 2023

This PR applies all automatic cleanups that IntelliJ is confident enough to apply silently with no further user input; a rough summary of the different kinds of change are:

  • Removal of redundant casts (T t = (T) v where v already has type T).
  • Removal of unnecessary calls to toString()
  • Insertion of final where possible
  • Collapsing of redundant boolean conditions if (cond) return true else return false
  • Syntactic fixes (;; etc.)
  • Use of StandardCharsets.UTF_8 to simplify exception checks when encoding strings
  • Removal of redundant explicit key checks when removing values from hashmaps

As ever, I'm happy to bikeshed these changes - I can redo the analysis and disable some subset of the checks if anyone has objections to the specific results we get.

To avoid merge conflicts, this PR is based on #3746 and should only be merged when that PR is merged.

@Baltoli Baltoli marked this pull request as ready for review October 26, 2023 09:13
Copy link
Contributor

@radumereuta radumereuta left a comment

Choose a reason for hiding this comment

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

Overall, it looks good. I added a question though. Please double check.

@rv-jenkins rv-jenkins merged commit 8334e31 into develop Oct 26, 2023
8 checks passed
@rv-jenkins rv-jenkins deleted the java-trivial branch October 26, 2023 11:23
@Baltoli Baltoli mentioned this pull request Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants