Closed vlsi closed 8 months ago
Hi! I've moved this issue to the Gradle plugin specifically, as that's what you appear to be use for pgjdbc; we recently added a small diagnostic help to the rewrite-maven-plugin. Looks like the Gradle plugin could use the same.
I updated openrewrite-snapshot today, and it somehow fixed the parsing issue. The issue seems to be fixed now.
> The following files have format violations. Execute ./gradlew :postgresql:rewriteRun to apply the changes:
diff --git a/pgjdbc/src/main/java/org/postgresql/core/QueryExecutorBase.java b/pgjdbc/src/main/java/org/postgresql/core/QueryExecutorBase.java
index 9e84236..fff8807 100644
--- a/pgjdbc/src/main/java/org/postgresql/core/QueryExecutorBase.java
+++ b/pgjdbc/src/main/java/org/postgresql/core/QueryExecutorBase.java
@@ -45,7 +45,7 @@ org.openrewrite.config.CompositeRecipe
private int cancelKey;
protected final QueryExecutorCloseAction closeAction;
private @MonotonicNonNull String serverVersion;
- private int serverVersionNum = 0;
+ private int serverVersionNum;
private TransactionState transactionState = TransactionState.IDLE;
private final boolean reWriteBatchedInserts;
private final boolean columnSanitiserDisabled;
@@ -57,17 +57,17 @@
protected final boolean logServerErrorDetail;
// default value for server versions that don't report standard_conforming_strings
- private boolean standardConformingStrings = false;
+ private boolean standardConformingStrings;
private @Nullable SQLWarning warnings;
- private final ArrayList<PGNotification> notifications = new ArrayList<PGNotification>();
+ private final ArrayList<PGNotification> notifications = new ArrayList<>();
Glad to hear the problem has been resolved, and thanks for checking again and closing the issue yourself. Really helps us!
What version of OpenRewrite are you using?
latest.integration
Here's a relevant bit of
--debug
output:The code is at https://github.com/pgjdbc/pgjdbc/pull/2979