Skip to content

Move JSpecify annotations closest to the target and enable NullAway annotation check#39

Merged
ThoSap merged 18 commits intomainfrom
move-jspecify-annotations-closest-to-the-target
Mar 4, 2026
Merged

Move JSpecify annotations closest to the target and enable NullAway annotation check#39
ThoSap merged 18 commits intomainfrom
move-jspecify-annotations-closest-to-the-target

Conversation

@ThoSap
Copy link
Contributor

@ThoSap ThoSap commented Feb 26, 2026

In another project, we agreed to have the JSpecify annotations always closest to their targets.

As the JSpecify annotations @NonNull and @Nullable are TYPE_USE only annotations (Lombok @NonNull also allows FIELD, LOCAL_VARIABLE, and more types), I think it also makes sense to move this next to the return type, as well as special cases, like we already need to do for example in cases like inner classes (RoleSpec.@Nullable Flags), where this is strictly required.

I also enabled RequireExplicitNullMarking, which immediately detected that class BlankSource was not annotated with @NullMarked or @NullUnmarked.

https://jspecify.dev/docs/user-guide/#type-use-annotation-syntax
image

…refactor-secret-ref-and-cluster-reference-to-resource-ref

# Conflicts:
#	operator/src/main/java/it/aboutbits/postgresql/core/ClusterReference.java
#	operator/src/main/java/it/aboutbits/postgresql/core/SecretRef.java
#	operator/src/main/java/it/aboutbits/postgresql/core/schema_customizer/HostCustomizer.java
#	operator/src/main/java/it/aboutbits/postgresql/crd/clusterconnection/ClusterConnectionSpec.java
…hat are not annotated with JSpecify annotations
@ThoSap ThoSap requested a review from SirCotare February 26, 2026 09:33
@ThoSap ThoSap self-assigned this Feb 26, 2026
…ef' into move-jspecify-annotations-closest-to-the-target
…refactor-secret-ref-and-cluster-reference-to-resource-ref

# Conflicts:
#	operator/src/main/java/it/aboutbits/postgresql/core/ClusterReference.java
#	operator/src/main/java/it/aboutbits/postgresql/core/SecretRef.java
…ef' into move-jspecify-annotations-closest-to-the-target

# Conflicts:
#	operator/src/main/java/it/aboutbits/postgresql/core/ResourceRef.java
Base automatically changed from refactor-secret-ref-and-cluster-reference-to-resource-ref to main February 26, 2026 14:06
# Conflicts:
#	docs/cluster-connection.md
#	docs/database.md
#	docs/default-privilege.md
#	docs/grant.md
#	docs/role.md
#	docs/schema.md
#	operator/src/main/java/it/aboutbits/postgresql/core/ResourceRef.java
#	operator/src/main/java/it/aboutbits/postgresql/crd/clusterconnection/ClusterConnectionSpec.java
#	operator/src/main/java/it/aboutbits/postgresql/crd/role/RoleSpec.java
#	operator/src/test/java/it/aboutbits/postgresql/_support/testdata/persisted/creator/ClusterConnectionCreate.java
#	operator/src/test/java/it/aboutbits/postgresql/_support/testdata/persisted/creator/RoleCreate.java
#	operator/src/test/java/it/aboutbits/postgresql/_support/testdata/persisted/creator/SecretRefCreate.java
Copy link

@SirCotare SirCotare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ThoSap ThoSap merged commit e9dacac into main Mar 4, 2026
4 checks passed
@ThoSap ThoSap deleted the move-jspecify-annotations-closest-to-the-target branch March 4, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants