pgjdbc/pgjdbc GitHub issues and pull requests (mirror)
help / color / mirror / Atom feedFrom: vlsi (@vlsi) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: Re: [pgjdbc/pgjdbc] PR #3396: SQLData Support
Date: Wed, 23 Oct 2024 08:19:33 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
(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;
```
view thread (67+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: github://pgjdbc/pgjdbc
Cc: [email protected], [email protected]
Subject: Re: [pgjdbc/pgjdbc] PR #3396: SQLData Support
In-Reply-To: <<[email protected]>>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox