openrewrite / openrewrite/rewrite-static-analysis
Issue discovered on `src/main/java/org/openrewrite/java/migrate/AddJDeprScanPlugin.java` with `Fix `String#format` and `String#formatted` expressions`
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 62
- Forks
- 112
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 40
Description
Problem
Describe the issue you are experiencing.
Expected behavior
Describe what you expected to see.
Example diff
From: src/main/java/org/openrewrite/java/migrate/AddJDeprScanPlugin.java
"org.apache.maven.plugins",
"maven-jdeprscan-plugin",
"3.0.0-alpha-1",
- String.format("<configuration>
<release>%s</release>
</configuration>",
+ String.format("<configuration>%n <release>%s</release>%n</configuration>",
StringUtils.isNullOrEmpty(getRelease()) ? "11" : getRelease()),
null,
null));
Recipes in example diff:
org.openrewrite.java.cleanup.FixStringFormatExpressions
References:
- View original result
- Recipe ID:
org.openrewrite.java.cleanup.FixStringFormatExpressions - Recipe Name:
FixString#formatandString#formattedexpressions - Repository:
openrewrite/rewrite-migrate-java/main - Created at Thu Dec 29 2022 22:00:23 GMT-0500 (Eastern Standard Time)
This issue originally created by @jkschneider on: https://github.com/moderneinc/support-public/issues/17
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 inspecting the FixStringFormatExpressions recipe and the reported source at src/main/java/org/openrewrite/java/migrate/AddJDeprScanPlugin.java. Reproduce the example transformation and verify that String.format and String.formatted expressions produce the expected newline formatting shown in the diff.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100