8000 Many mostly automated code quality fixups by StenAL · Pull Request #111 · PhilippvK/playforia-minigolf · GitHub
[go: up one dir, main page]

Skip to content

Many mostly automated code quality fixups - #111

Merged
PhilippvK merged 6 commits into
PhilippvK:masterfrom
StenAL:features
Jul 1, 2024
Merged

PhilippvK merged 6 commits into
PhilippvK:masterfrom
StenAL:features

Conversation

@StenAL
@StenAL StenAL commented May 31, 2024
Copy link
Copy Markdown

IntelliJ and Maven were complaining about lots of warnings and offering automatic fixups for most of them. This PR integrates the following fixes:

  • remove uses of deprecated boxed number constructors
  • fix most warnings about unchecked collection usage
  • remove redundant casts
  • remove all unused imports
  • use String.repeat() instead of for-loop for string building (available
    since Java 11)
  • use enchanced for loop (i.e. for (Class item: collection)) where
    possible (available since Java 5)
  • remove unnecessary unboxing of wrapped types, i.e. calls to
    .intValue() (available since Java 5)
  • use diamond shorthand (<>) in generics where available (available
    since Java 7)
  • replace C-style array declarations with Java style declarations
  • remove unnecessary character escapes
  • replace manual min/max calculations with Math.min/max calls
  • remove redundant array initializations
  • convert some Javadoc comments to normal multiline comments, remove
    other useless ones
  • remove some unused imports
  • remove redundant "throws" clauses
  • remove redundant semicolons from empty catch blocks
  • remove unnecessary toString calls
  • use magic constants (e.g. Font.PLAIN) instead of integers where
    possible

StenAL added 6 commits May 31, 2024 20:23
Maven and IntelliJ were complaining about missing generics so I added
them everywhere.
This is an automated change done by IntelliJ.
IntelliJ was complaining about many warnings and offered automatic fixes
for them so this commit applies the following changes:
- use String.repeat() instead of for-loop for string building (available
 since Java 11)
- use enchanced for loop (i.e. `for (Class item: collection)`) where
  possible (available since Java 5)
- remove unnecessary unboxing of wrapped types, i.e. calls to
  .intValue() (available since Java 5)
- use diamond shorthand (<>) in generics where available (available
  since Java 7)
- replace C-style array declarations with Java style declarations
- remove unnecessary character escapes
- replace manual min/max calculations with Math.min/max calls
- remove redundant array initializations
- convert some Javadoc comments to normal multiline comments, remove
other useless ones
- remove some unused imports
- remove redundant "throws" clauses
- remove redundant semicolons from empty catch blocks
- remove unnecessary toString calls
- use magic constants (e.g. Font.PLAIN) instead of integers where
  possible
All other files in the client project use LF line endings.
Done with `find client -type f | xargs dos2unix`
@PhilippvK
PhilippvK merged commit a42cf4d into PhilippvK:master Jul 1, 2024
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.

2 participants

0