Repository navigation
Enable Error Prone and fail builds on unclosed @MustBeClosed resources and leaked streams - #1565
Merged
Merged
Conversation
…s and leaked streams Adds matching IntelliJ inspections and downgrades CompileTimeConstant to a warning.
This was referenced Nov 27, 2026
labkey-adam
requested review from
labkey-jeckels,
labkey-matthewb and
labkey-nicka
November 27, 2026 20:03
labkey-adam
added a commit
to LabKey/MacCossLabModules
that referenced
this pull request
Nov 27, 2026
## Rationale Make panoramapublic compile under the newly enforced Error Prone `StreamResourceLeak` check. ## Related Pull Requests - LabKey/server#1565 - LabKey/platform#8392 - LabKey/premiumModules#885 - LabKey/limsModules#2640 ## Changes - Close the file stream used to read the DIA-NN report header
labkey-jeckels
approved these changes
Nov 28, 2026
labkey-jeckels
left a comment
Contributor
There was a problem hiding this comment.
Where did the IntelliJ inspection version of the checks come from? We will presumably be wanting more in the future, so it would be good to have a reference for how to add or update them
Contributor
Author
Claude created them based on the pattern @labkey-matthewb set with his |
labkey-adam
added a commit
to LabKey/platform
that referenced
this pull request
Nov 28, 2026
## Rationale Make platform compile under the newly enforced Error Prone `MustBeClosedChecker` and `StreamResourceLeak` checks. ## Related Pull Requests - LabKey/server#1565 - LabKey/premiumModules#885 - LabKey/limsModules#2640 - LabKey/MacCossLabModules#700 ## Changes - Annotate methods that return result-set-backed streams with `@MustBeClosed` - Close streams that were left open - Fix a variable-name typo in sample search indexing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale
Turn on Error Prone for every build and make unclosed
@MustBeClosedresources and unclosedFilesstreams compile errors, so leaked result sets and file handles are caught at build time instead of in production. Error Prone was previously off by default, and both checks were configured only as warnings.Related Pull Requests
Changes
MustBeClosedCheckerandStreamResourceLeakerrors; downgradeCompileTimeConstantto a warning