Message-ID: From: "vlsi (@vlsi)" To: "pgjdbc/pgjdbc" Date: Wed, 23 Oct 2024 08:19:33 +0000 Subject: Re: [pgjdbc/pgjdbc] PR #3396: SQLData Support In-Reply-To: References: List-Id: X-GitHub-Author-Login: vlsi X-GitHub-Comment-Id: 1812159504 X-GitHub-Comment-Type: review_comment X-GitHub-Commit: e2494a12810eb7b402d8c51535559606f2e5571a X-GitHub-Issue: 3396 X-GitHub-Path: pgjdbc/src/main/java/org/postgresql/jdbc/PgArray.java X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: review_comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/3396#discussion_r1812159504 Content-Type: text/plain; charset=utf-8 (on pgjdbc/src/main/java/org/postgresql/jdbc/PgArray.java) This fails because `array` is declared as an array holding non-nullable, so the checker forbids assigning `null` there. If you need nullable array of nullable objects, then you need to declare it as `@Nullable Object @Nullable [] array` --- Here's a quick tip: https://github.com/pgjdbc/pgjdbc/blob/master/CONTRIBUTING.md#null-safety ```java // array and elements: non-nullable String[] x; // array: nullable, elements: non-nullable String @Nullable [] x; // array: non-nullable, elements: nullable @Nullable String[] x; // array: nullable, elements: nullable @Nullable String @Nullable [] x; ```