Make codegen default to jspecify NonNull annotations (#1607)

With JSpecify now a dependency of pkl-config-java, this moves the
non-null annotation to jspecify's.
This makes it simpler for users to do nullness checks, as tooling
already understands JSpecify nullness annotations.
This commit is contained in:
Daniel Chao
2026-05-21 21:12:15 -07:00
committed by GitHub
parent 8e2e5e4ba8
commit da4dd4c4f8
9 changed files with 22 additions and 10 deletions
@@ -1,5 +1,5 @@
/*
* Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,8 +21,16 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/** Indicates that a type does not accept {@code null} as a value. */
/**
* Indicates that a type does not accept {@code null} as a value.
*
* <p>This annotation is deprecated, and any usage should be replaced with {@link
* org.jspecify.annotations.NonNull}.
*
* @deprecated since 0.32.0
*/
@Target({ElementType.TYPE_PARAMETER, ElementType.TYPE_USE})
@Retention(RetentionPolicy.CLASS)
@Documented
@Deprecated(forRemoval = true)
public @interface NonNull {}