openrewrite / openrewrite/rewrite-static-analysis
use `try-with-resources` statement
Open
Nobody has claimed this yet.
enhancement
recipe
- Dominant language
- Java
- Stars
- 62
- Forks
- 112
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 40
Description
What problem are you trying to solve?
- https://github.com/apache/maven/pull/2426
- https://pmd.github.io/pmd/pmd_rules_java_bestpractices.html#usetrywithresources
- https://mail.openjdk.org/pipermail/coin-dev/2009-April/001503.html
Describe the solution you'd like
Have you considered any alternatives or workarounds?
ide fix:
Additional context
Are you interested in contributing this feature to OpenRewrite?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing Java static-analysis recipes in this repository and the linked Maven, PMD, OpenJDK, and Baeldung references. Define the intended try-with-resources cases, then verify that the recipe identifies and fixes applicable resource-handling code with tests covering the supported cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100