Closed vlsi closed 9 months ago
Sample code in pgjdbc: https://github.com/pgjdbc/pgjdbc/blob/135be5a4395033a4ba23a1dd70ad76e0bd443a8d/pgjdbc/src/main/java/org/postgresql/gss/GSSInputStream.java#L22
import org.checkerframework.checker.nullness.qual.Nullable; class Sample { byte @Nullable [] unencrypted; }
Gradle configuration:
plugins { id("org.openrewrite.rewrite") version "5.32.0" } dependencies { rewrite(platform("org.openrewrite.recipe:rewrite-recipe-bom:1.12.1")) rewrite("org.openrewrite.recipe:rewrite-java-security:1.19.0") } rewrite { activeRecipe("org.openrewrite.java.security.JavaSecurityBestPractices") activeRecipe("org.openrewrite.java.security.RegularExpressionDenialOfService") activeRecipe("org.openrewrite.java.security.ZipSlip") activeRecipe("org.openrewrite.java.cleanup.MissingOverrideAnnotation") activeRecipe("org.openrewrite.java.cleanup.Cleanup") activeRecipe("org.openrewrite.java.cleanup.NoWhitespaceAfter") }
./gradlew rewriteDryRun output:
./gradlew rewriteDryRun
diff --git a/pgjdbc/src/main/java/org/postgresql/gss/GSSInputStream.java b/pgjdbc/src/main/java/org/postgresql/gss/GSSInputStream.java index 518f622..4210016 100644 --- a/pgjdbc/src/main/java/org/postgresql/gss/GSSInputStream.java +++ b/pgjdbc/src/main/java/org/postgresql/gss/GSSInputStream.java @@ -19,7 +19,7 @@ org.openrewrite.java.cleanup.NoWhitespaceAfter private GSSContext gssContext; private MessageProp messageProp; private InputStream wrapped; - byte @Nullablebyte @Nullable [] unencrypted; + byte @Nullablebyte[] unencrypted; int unencryptedPos; int unencryptedLength;
After ./gradlew rewriteRun, the source becomes
./gradlew rewriteRun
byte @Nullablebyte[] unencrypted;
@vlsi Which recipe were you running when you encountered this issue?
This appears to be a duplicate of #2490
I'm inclined #2490 is a variation of this as 2443 < 2490
This has now been fixed by #3848.
Sample code in pgjdbc: https://github.com/pgjdbc/pgjdbc/blob/135be5a4395033a4ba23a1dd70ad76e0bd443a8d/pgjdbc/src/main/java/org/postgresql/gss/GSSInputStream.java#L22
Gradle configuration:
./gradlew rewriteDryRun
output:After
./gradlew rewriteRun
, the source becomes