Skip to content

Conversation

@labkey-jeckels
Copy link
Contributor

Rationale

We can cleanup tens of thousands of warnings across our codebase with IntelliJ's autorefactors. In some cases, this adopts newer, leaner syntax. In others, it simply removes code that's not serving any purpose.

Related Pull Requests

Changes

  • Auto-refactors
    • Eliminate redundant toString()
    • Eliminate redundant cast
    • Empty JavaDoc annotations
    • Member variable can be final
    • length() and size() -> isEmpty()
    • Add missing @OverRide
    • Class can be static
    • Remove unused imports
    • toArray() passed array length
    • Remove unnecessary semicolon
    • Explicit type syntax can be replaced by <>
    • Redundant access modifiers
    • Remove redundant initializer
    • "".equals() -> isEmpty()
    • StringBuilder can be replaced by String
    • Fix misordered arguments to assertEquals()
    • StringUtils.defaultString() - Objects.toString()
    • Cast can be replaced with pattern variable
    • Collapse identical catch blocks
    • Type may be primitive
  • Manual fixups
    • Delete unused GWT code
    • Improve generics
    • new UnexpectedException() -> UnexpectedException.wrap()

@labkey-jeckels labkey-jeckels requested a review from a team June 8, 2025 22:06
@labkey-jeckels labkey-jeckels self-assigned this Jun 8, 2025
Copy link
Contributor

@labkey-adam labkey-adam left a comment

Choose a reason for hiding this comment

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

I think an assignment got dropped accidentally (InboundSpecimenUpdateService)

Date birthDate;
if (row.get("BirthDate") instanceof Date)
birthDate = (Date) row.get("BirthDate");
row.get("BirthDate");
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing assignment here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IntelliJ dropped the assignment with an auto-refactor. Turns out the value wasn't being used. I restore the assignment and moved the validation to happen whether the value was provided as a Date or a String

@labkey-jeckels labkey-jeckels merged commit 99a39b1 into develop Jun 11, 2025
10 checks passed
@labkey-jeckels labkey-jeckels deleted the fb_autoRefactorCleanup branch June 11, 2025 21:34
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.

4 participants