openrewrite / openrewrite/rewrite-static-analysis

`RemoveUnused(Local)Parameter/RemoveUnusedParameters`

Open
#780 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
62
Forks
112
Avg merge
1d 19h
Merged PRs (30d)
40

Description

What problem are you trying to solve?

It seems this one the missing in the "gang of four" handling all unused stuff.

Checking into localvars and fields it seems parameters are not taken care yet.

It should simply remove as happy path. Maybe some hybrid mode via opt in switch would help to keep public api stable by changing the name to unused to pass inspection and dont make a breaking change on top lvl.

Describe the solution you'd like

Have you considered any alternatives or workarounds?

Additional context

Are you interested in contributing this feature to OpenRewrite?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the existing RemoveUnusedPrivateMethods, RemoveUnusedLocalVariables, and RemoveUnusedPrivateFields recipes referenced in the issue, along with the Error Prone UnusedVariable guidance. Define handling for unused local and method parameters, including the proposed public-API compatibility option. Done means the recipe removes unused parameters in the supported happy path and preserves public API behavior when the compatibility mode is used.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.