EmptyBlock and RemoveMethodsOnlyCallSuper delete blocks and methods whose only content is a comment
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by reading the EmptyBlock and RemoveMethodsOnlyCallSuper recipes and tracing how each inspects statement lists versus attached comments. The issue does not name tests or files beyond these recipes; done would require an agreed policy for comment-only bodies and corresponding behavior coverage.
Written by the indexing model from the issue text.
Description
EmptyBlock and RemoveMethodsOnlyCallSuper both decide what to remove by looking at the statement list, without considering the comments attached to it. A block whose body is only a comment counts as empty, and an override whose body is a comment plus the super call counts as only calling super.
I would like to know how you see it before I suggest anything:
- Is this the intended behavior? There is a reasonable reading where a comment is not code, so a block containing only a comment really is empty.
- If it is intended, is it nonetheless a problem worth changing? The removal compiles cleanly, so nothing fails and the note is simply gone.
- If it should change, should the recipes always preserve a commented block or method, or should this be configurable?
It matters to me because the comments being deleted are TODOs recording work that still needs doing at exactly that spot. Several are reminders that a method needs a real implementation rather than the super call currently standing in for one.
- Dominant language
- Java
- Stars
- 64
- Forks
- 116
- Avg merge
- 6h 52m
- Merged PRs (30d)
- 144
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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.
More from openrewrite/rewrite-static-analysis
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
openrewrite/rewrite-static-analysis#985 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 5/5 Over a week Newbie friendliness 35/100
openrewrite/rewrite-static-analysis#1116 · 7 comments ·
Maintainers usually reply within 1 day
-
Recipe quality triage: mechanical polish (M1–M16)Possibly taken @timtebeek claimed this 16 days ago. Open
openrewrite/rewrite-static-analysis#1115 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
`SimplifyElseBranch` puts comment in not the best locationMay be free again @abhinav-1504 claimed this 180 days ago, and no pull request is open. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 48/100
openrewrite/rewrite-static-analysis#878 · 4 comments ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 45/100
openrewrite/rewrite-static-analysis#803 · 3 comments ·
Maintainers usually reply within 1 day
All issues in openrewrite/rewrite-static-analysis
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
SasanLabs/VulnerableApp#912 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
desktop edt not responding
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
datafusion-contrib/StreamFusion#653 ·
Maintainers usually reply within 1 day
-
[Bug] Absolute row/column index 0 is ignored for images, hyperlinks and commentsPossibly taken @fanOfSunny claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day