rewrite-static-analysis
rewrite-static-analysis copied to clipboard
OpenRewrite recipes for identifying and fixing static analysis issues.
## What's changed? Fix for DefaultComesLast recipe creates duplicate case #289 ## What's your motivation? Bug fix
If default comes before a case and simply continues into that case ```java default: case DERIVATION_MODE: System.out.println("default"); break; ``` refactoring with `org.openrewrite.staticanalysis.DefaultComesLast` from `org.openrewrite.recipe:rewrite-static-analysis:1.6.0` results in a duplicate case and...
As [discussed here](https://github.com/openrewrite/rewrite-static-analysis/pull/108#issuecomment-1547448538) the `ExplicitInitialization` currently doesn't remove the explicit initializers from fields in anonymous subclasses (`J.NewClass` instances with a `body`). It would be good if it could be extended...
## What version of OpenRewrite are you using? I am using the latest version as of 2024-04-02 ## How are you running OpenRewrite? I am using the Maven plugin, and...
## What problem are you trying to solve? When using ParameterizedLogging, the output is not compatible in my IDE, since restriction is placed on autoboxing usage. I wish I can...
## What problem are you trying to solve? Lets imagine you have wrong class javadoc like this: ``` /** * @param * type of product * @author John * @since...
## What version of OpenRewrite are you using? I am using - Maven/Gradle plugin v5.22.0 - rewrite-static-analysis_v1.3.0 ## How are you running OpenRewrite? I am using the Maven plugin, and...
## What's changed? This PR will enable the transformation of lambdas with method invocation as body within assertThrows, a feature that unexpectedly wasn't fixed with https://github.com/openrewrite/rewrite-static-analysis/pull/241. ## What's your motivation?...
## What problem are you trying to solve? I've come across ```java if (authentication.getPrincipal() instanceof UserDetails) { UserDetails springSecurityUser = (UserDetails) authentication.getPrincipal(); return springSecurityUser.getUsername(); } ``` which is currently not...
## What problem are you trying to solve? Just came across this finding from IntelliJ: ```java String upperFoo = "FoO" "foo".equals(upperFoo.toLowercase()) ``` can be ```java String upperFoo = "FoO" "foo".equalsToIgnoreCase(upperFoo)...