Skip to content

Commit 94a585e

Browse files
committed
move the JSpecify annotations closest to their target
1 parent 4f0adcc commit 94a585e

51 files changed

Lines changed: 127 additions & 185 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

operator/src/main/java/it/aboutbits/postgresql/PostgreSQLInstanceReadinessCheck.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
* configured PostgreSQL instances. Each instance is probed with a lightweight
1616
* operation, and the aggregated status is exposed.
1717
*/
18-
@NullMarked
1918
@Readiness
2019
@RequiredArgsConstructor
20+
@NullMarked
2121
public class PostgreSQLInstanceReadinessCheck implements HealthCheck {
2222
private final PostgreSQLContextFactory postgreSQLContextFactory;
2323

operator/src/main/java/it/aboutbits/postgresql/core/BaseReconciler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
import java.util.Optional;
1515
import java.util.concurrent.TimeUnit;
1616

17-
@NullMarked
1817
@Slf4j
18+
@NullMarked
1919
public abstract class BaseReconciler<CR extends CustomResource<?, S> & Named, S extends CRStatus> {
2020
protected abstract S newStatus();
2121

operator/src/main/java/it/aboutbits/postgresql/core/CRStatus.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,15 @@
1515
* <p>
1616
* This object captures the current state of a Custom Resource as observed by the reconciler.
1717
*/
18-
@NullMarked
1918
@Getter
2019
@Setter
2120
@Accessors(chain = true)
21+
@NullMarked
2222
public class CRStatus {
2323
/**
2424
* The Custom Resource name (may differ from metadata.name).
2525
*/
26-
@Nullable
27-
private String name = null;
26+
private @Nullable String name = null;
2827

2928
/**
3029
* Current lifecycle phase of the Bucket.
@@ -35,21 +34,18 @@ public class CRStatus {
3534
/**
3635
* Human-readable message providing details about the current state.
3736
*/
38-
@Nullable
39-
private String message = null;
37+
private @Nullable String message = null;
4038

4139
/**
4240
* Last time the condition was probed/updated.
4341
*/
44-
@Nullable
45-
private OffsetDateTime lastProbeTime = null;
42+
private @Nullable OffsetDateTime lastProbeTime = null;
4643

4744
/**
4845
* Last time the condition transitioned from one status to another.
4946
*/
50-
@Nullable
5147
@Setter(AccessLevel.NONE)
52-
private OffsetDateTime lastPhaseTransitionTime = null;
48+
private @Nullable OffsetDateTime lastPhaseTransitionTime = null;
5349

5450
/**
5551
* Observed resource generation that the controller acted upon.

operator/src/main/java/it/aboutbits/postgresql/core/KubernetesService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import java.nio.charset.Charset;
99
import java.util.Base64;
1010

11-
@NullMarked
1211
@Singleton
12+
@NullMarked
1313
public final class KubernetesService {
1414
public static final String SECRET_TYPE_BASIC_AUTH = "kubernetes.io/basic-auth";
1515
public static final String SECRET_DATA_BASIC_AUTH_USERNAME_KEY = "username";

operator/src/main/java/it/aboutbits/postgresql/core/PostgreSQLAuthenticationService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121

2222
import static it.aboutbits.postgresql.core.infrastructure.persistence.Tables.PG_AUTHID;
2323

24-
@NullMarked
2524
@Slf4j
2625
@Singleton
26+
@NullMarked
2727
public final class PostgreSQLAuthenticationService {
2828
private static final String MD5 = "MD5";
2929
private static final String SHA_256 = "SHA-256";

operator/src/main/java/it/aboutbits/postgresql/core/PostgreSQLContextFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
import java.util.Properties;
1313

14-
@NullMarked
1514
@ApplicationScoped
1615
@RequiredArgsConstructor
16+
@NullMarked
1717
public class PostgreSQLContextFactory {
1818
private static final String POSTGRESQL_AUTHENTICATION_USER_KEY = "user";
1919
private static final String POSTGRESQL_AUTHENTICATION_PASSWORD_KEY = "password";

operator/src/main/java/it/aboutbits/postgresql/core/Privilege.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
* https://www.postgresql.org/docs/current/sql-grant.html
1616
* </a>
1717
*/
18-
@NullMarked
1918
@Getter
2019
@Accessors(fluent = true)
2120
@RequiredArgsConstructor
21+
@NullMarked
2222
public enum Privilege {
2323
SELECT(null),
2424
INSERT(null),
@@ -33,8 +33,7 @@ public enum Privilege {
3333
USAGE(null),
3434
MAINTAIN(17);
3535

36-
@Nullable
37-
private final Integer minimumPostgresVersion;
36+
private final @Nullable Integer minimumPostgresVersion;
3837

3938
@JsonValue
4039
public String toValue() {

operator/src/main/java/it/aboutbits/postgresql/core/ReclaimPolicy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import lombok.RequiredArgsConstructor;
55
import org.jspecify.annotations.NullMarked;
66

7-
@NullMarked
87
@RequiredArgsConstructor
8+
@NullMarked
99
public enum ReclaimPolicy {
1010
RETAIN("Retain"),
1111
DELETE("Delete");

operator/src/main/java/it/aboutbits/postgresql/core/ResourceRef.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,15 @@
2525
/// |-------------------|-----------------------------------------------------|
2626
/// | non-null | the explicit namespace |
2727
/// | `null` (omitted) | the namespace of the CR that owns this reference |
28-
@NullMarked
2928
@Getter
3029
@Setter
3130
@SchemaCustomizer(KubernetesNameCustomizer.class)
31+
@NullMarked
3232
public class ResourceRef {
3333
/// The namespace of the referenced Kubernetes resource.
3434
/// If `null`, defaults to the namespace of the CR that defines this reference.
35-
@Nullable
3635
@io.fabric8.generator.annotation.Nullable
37-
private String namespace;
36+
private @Nullable String namespace;
3837

3938
@Required
4039
@ValidationRule(

operator/src/main/java/it/aboutbits/postgresql/crd/clusterconnection/ClusterConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import java.nio.charset.StandardCharsets;
1515
import java.util.StringJoiner;
1616

17-
@NullMarked
1817
@Version("v1")
1918
@Group("postgresql.aboutbits.it")
2019
@AdditionalPrinterColumn(
@@ -42,6 +41,7 @@
4241
jsonPath = ".metadata.creationTimestamp",
4342
type = AdditionalPrinterColumn.Type.DATE
4443
)
44+
@NullMarked
4545
public class ClusterConnection
4646
extends CustomResource<ClusterConnectionSpec, CRStatus>
4747
implements Namespaced, Named {

0 commit comments

Comments
 (0)