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.

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()

@brentlogan
Copy link

@labkey-jeckels, thanks for the heads up. Is this intended for 25.7?

@labkey-jeckels
Copy link
Contributor Author

@labkey-jeckels, thanks for the heads up. Is this intended for 25.7?

Yes. These changes touch a lot of lines of code, but the changes are very straightforward and mechanical in nature.

# Conflicts:
#	api/src/org/labkey/api/data/ResultSetView.java
#	api/src/org/labkey/api/study/reports/CrosstabView.java
#	api/src/org/labkey/api/view/Stats.java
#	pipeline/src/org/labkey/pipeline/PipelineWebPart.java
@labkey-jeckels labkey-jeckels merged commit 9c01323 into develop Jun 11, 2025
20 of 23 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.

5 participants