Skip to content

Use try-with-resources in WKT and WKB readers#1210

Open
Oz-er wants to merge 1 commit into
locationtech:masterfrom
Oz-er:master
Open

Use try-with-resources in WKT and WKB readers#1210
Oz-er wants to merge 1 commit into
locationtech:masterfrom
Oz-er:master

Conversation

@Oz-er

@Oz-er Oz-er commented Jun 22, 2026

Copy link
Copy Markdown

Summary

This PR simplifies resource management in WKTFileReader and WKBHexFileReader.

Changes

  • Replaced nested try/finally blocks with try-with-resources.
  • Kept reader cleanup behavior unchanged.
  • Kept the change localized to the two reader classes.

Rationale

Both classes used similar manual resource-closing logic. Try-with-resources makes the cleanup behavior clearer and
less error-prone while preserving existing behavior.

Validation

Ran:

mvn -pl modules/core verify

Result:

- Checkstyle: 0 violations
- Tests run: 2294
- Failures: 0
- Errors: 0
- PMD completed
- Build successful

Signed-off-by: Omer <omerwork3388@gmail.com>
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.

1 participant