Message-ID: From: "vlsi (@vlsi)" To: "pgjdbc/pgjdbc" Date: Fri, 11 Jul 2025 17:26:18 +0000 Subject: [pgjdbc/pgjdbc] issue #3725: Add @Contract annotation for clarifying nullability constraints List-Id: X-GitHub-Author-Id: 213894 X-GitHub-Author-Login: vlsi X-GitHub-Issue: 3725 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-State: open X-GitHub-Type: issue X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/3725 Content-Type: text/plain; charset=utf-8 See https://github.com/junit-team/junit-framework/issues/4722 It turns out we could add pgjdbc's `@Contract` annotation and use it for cases like `@Contract("null, _ -> null")` which means "returns `null` if the first argument is `null`". Currently, we use a bunch of `@PolyNull` annotations for those cases, however, it looks like we could make Nullaway and IDEA aware of the contracts if we add the annotation.