Skip to content

Commit 74e52e7

Browse files
committed
Adds package-info file, sets package as @NullMarked, and adds Jspecify @nullable annotation to AgentCardProducer, getEnvOrDefault Method and AgentExecutorProducer execute Method. Fixes #336
1 parent 47c906f commit 74e52e7

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

tck/src/main/java/io/a2a/tck/server/AgentCardProducer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import io.a2a.spec.AgentInterface;
1313
import io.a2a.spec.AgentSkill;
1414
import io.a2a.spec.TransportProtocol;
15+
import org.jspecify.annotations.Nullable;
1516

1617
@ApplicationScoped
1718
public class AgentCardProducer {
@@ -53,7 +54,7 @@ public AgentCard agentCard() {
5354
.build();
5455
}
5556

56-
private static String getEnvOrDefault(String envVar, String defaultValue) {
57+
private static String getEnvOrDefault(@Nullable String envVar, String defaultValue) {
5758
String value = System.getenv(envVar);
5859
return value == null || value.isBlank() ? defaultValue : value;
5960
}

tck/src/main/java/io/a2a/tck/server/AgentExecutorProducer.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import jakarta.enterprise.context.ApplicationScoped;
55
import jakarta.enterprise.inject.Produces;
66

7+
import org.jspecify.annotations.Nullable;
8+
79
import io.a2a.server.agentexecution.AgentExecutor;
810
import io.a2a.server.agentexecution.RequestContext;
911
import io.a2a.server.events.EventQueue;
@@ -26,7 +28,7 @@ public AgentExecutor agentExecutor() {
2628

2729
private static class FireAndForgetAgentExecutor implements AgentExecutor {
2830
@Override
29-
public void execute(RequestContext context, EventQueue eventQueue) throws JSONRPCError {
31+
public void execute(@Nullable RequestContext context, EventQueue eventQueue) throws JSONRPCError {
3032
Task task = context.getTask();
3133

3234
if (task == null) {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@NullMarked
2+
package io.a2a.tck.server;
3+
4+
import org.jspecify.annotations.NullMarked;
5+
6+
//The following had @Nullable annotation applied from JSpecify
7+
//AgentCardProducer.java getEnvOrDefault method,
8+
//AgentExecutorProducer.java execute method
9+
//
10+

0 commit comments

Comments
 (0)