Skip to content

Conversation

@labkey-jeckels
Copy link

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 review from a team and bbimber June 8, 2025 22:23
@labkey-jeckels labkey-jeckels self-assigned this Jun 8, 2025
Integer value = Integer.parseInt(a);
return (value.intValue() & 2) == 0;
int value = Integer.parseInt(a);
return ((int) value & 2) == 0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

does this need a cast? I can see how an auto-refactor might do that

Copy link
Author

Choose a reason for hiding this comment

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

No, it didn't. Removed. If I had applied the auto-refactors in a different order (removing unneeded casts after switching to primitives) this would have gotten cleaned up automatically.

@labkey-nicka labkey-nicka removed the request for review from a team June 10, 2025 21:59
@labkey-jeckels labkey-jeckels merged commit c9fbe4a into develop Jun 10, 2025
7 of 9 checks passed
@labkey-jeckels labkey-jeckels deleted the fb_autoRefactorCleanup branch June 10, 2025 23:36
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