mirror of
https://github.com/apple/pkl.git
synced 2026-03-25 10:31:35 +01:00
Add targets for org.pkl.core.util.Nullable (#235)
Also, change `java.time.@Nullable Duration` to `@Nullable java.time.Duration` to reduce the chance of false positive errors in IDEs.
This commit is contained in:
@@ -48,7 +48,7 @@ public final class EvaluatorBuilder {
|
||||
|
||||
private final Map<String, String> externalProperties = new HashMap<>();
|
||||
|
||||
private java.time.@Nullable Duration timeout;
|
||||
private @Nullable java.time.Duration timeout;
|
||||
|
||||
private @Nullable Path moduleCacheDir = IoUtils.getDefaultModuleCacheDir();
|
||||
|
||||
@@ -343,7 +343,7 @@ public final class EvaluatorBuilder {
|
||||
/**
|
||||
* Sets an evaluation timeout to be enforced by the {@link Evaluator}'s {@code evaluate} methods.
|
||||
*/
|
||||
public EvaluatorBuilder setTimeout(java.time.@Nullable Duration timeout) {
|
||||
public EvaluatorBuilder setTimeout(@Nullable java.time.Duration timeout) {
|
||||
this.timeout = timeout;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -2169,7 +2169,7 @@ public final class AstBuilder extends AbstractAstBuilder<Object> {
|
||||
return builder;
|
||||
}
|
||||
|
||||
private FrameDescriptor.@Nullable Builder createFrameDescriptorBuilder(ObjectBodyContext ctx) {
|
||||
private @Nullable FrameDescriptor.Builder createFrameDescriptorBuilder(ObjectBodyContext ctx) {
|
||||
if (ctx.ps.isEmpty()) return null;
|
||||
|
||||
checkCommaSeparatedElements(ctx, ctx.ps, ctx.errs);
|
||||
|
||||
@@ -67,7 +67,7 @@ public final class Project {
|
||||
public static Project loadFromPath(
|
||||
Path path,
|
||||
SecurityManager securityManager,
|
||||
java.time.@Nullable Duration timeout,
|
||||
@Nullable java.time.Duration timeout,
|
||||
StackFrameTransformer stackFrameTransformer,
|
||||
Map<String, String> envVars) {
|
||||
try (var evaluator =
|
||||
@@ -90,7 +90,7 @@ public final class Project {
|
||||
|
||||
/** Convenience method to load a project with the default stack frame transformer. */
|
||||
public static Project loadFromPath(
|
||||
Path path, SecurityManager securityManager, java.time.@Nullable Duration timeout) {
|
||||
Path path, SecurityManager securityManager, @Nullable java.time.Duration timeout) {
|
||||
return loadFromPath(
|
||||
path, securityManager, timeout, StackFrameTransformers.defaultTransformer, System.getenv());
|
||||
}
|
||||
|
||||
@@ -20,7 +20,13 @@ import static javax.annotation.meta.When.MAYBE;
|
||||
import java.lang.annotation.*;
|
||||
import javax.annotation.meta.TypeQualifierNickname;
|
||||
|
||||
@Target({ElementType.TYPE_PARAMETER, ElementType.TYPE_USE})
|
||||
@Target({
|
||||
ElementType.TYPE_PARAMETER,
|
||||
ElementType.TYPE_USE,
|
||||
ElementType.PARAMETER,
|
||||
ElementType.FIELD,
|
||||
ElementType.METHOD
|
||||
})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@javax.annotation.Nonnull(when = MAYBE)
|
||||
|
||||
Reference in New Issue
Block a user