Skip to content

Annotate @MustBeClosed methods and fix unclosed streams - #8392

Merged
labkey-adam merged 1 commit into
developfrom
fb_enable_errorprone
Nov 28, 2026
Merged

labkey-adam merged 1 commit into
developfrom
fb_enable_errorprone

Conversation

@labkey-adam

@labkey-adam labkey-adam commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Rationale

Make platform compile under the newly enforced Error Prone MustBeClosedChecker and StreamResourceLeak checks.

Related Pull Requests

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

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-adam
labkey-adam merged commit b4c2c91 into develop Nov 28, 2026
13 checks passed
@labkey-adam
labkey-adam deleted the fb_enable_errorprone branch November 28, 2026 16:38
labkey-adam added a commit to LabKey/server that referenced this pull request Nov 28, 2026
…s and leaked streams (#1565)

## Rationale
Turn on Error Prone for every build and make unclosed `@MustBeClosed`
resources and unclosed `Files` streams 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
- LabKey/platform#8392
- LabKey/premiumModules#885
- LabKey/limsModules#2640
- LabKey/MacCossLabModules#700

## Changes
- Enable Error Prone by default
- Make `MustBeClosedChecker` and `StreamResourceLeak` errors; downgrade
`CompileTimeConstant` to a warning
- Add IntelliJ inspections that mirror both checks so violations show up
in the editor
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