Skip to content

Commit fab40d7

Browse files
committed
Remove unused methods/parameters
1 parent ece9af8 commit fab40d7

File tree

3 files changed

+4
-15
lines changed

3 files changed

+4
-15
lines changed

server-common/src/main/java/io/a2a/server/requesthandlers/DefaultRequestHandler.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
import jakarta.enterprise.context.ApplicationScoped;
2222
import jakarta.inject.Inject;
2323

24-
import org.eclipse.microprofile.config.inject.ConfigProperty;
25-
2624
import io.a2a.server.ServerCallContext;
2725
import io.a2a.server.agentexecution.AgentExecutor;
2826
import io.a2a.server.agentexecution.RequestContext;
@@ -53,11 +51,12 @@
5351
import io.a2a.spec.Task;
5452
import io.a2a.spec.TaskIdParams;
5553
import io.a2a.spec.TaskNotCancelableError;
56-
import io.a2a.spec.TaskState;
5754
import io.a2a.spec.TaskNotFoundError;
5855
import io.a2a.spec.TaskPushNotificationConfig;
5956
import io.a2a.spec.TaskQueryParams;
57+
import io.a2a.spec.TaskState;
6058
import io.a2a.spec.UnsupportedOperationError;
59+
import org.eclipse.microprofile.config.inject.ConfigProperty;
6160
import org.slf4j.Logger;
6261
import org.slf4j.LoggerFactory;
6362

@@ -240,7 +239,7 @@ public EventKind onMessageSend(MessageSendParams params, ServerCallContext conte
240239

241240
// Get agent future before consuming (for blocking calls to wait for agent completion)
242241
CompletableFuture<Void> agentFuture = runningAgents.get(taskId);
243-
etai = resultAggregator.consumeAndBreakOnInterrupt(consumer, blocking, pushNotificationCallback, agentFuture);
242+
etai = resultAggregator.consumeAndBreakOnInterrupt(consumer, blocking);
244243

245244
if (etai == null) {
246245
LOGGER.debug("No result, throwing InternalError");

server-common/src/main/java/io/a2a/server/tasks/ResultAggregator.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,6 @@ public EventKind consumeAll(EventConsumer consumer) throws JSONRPCError {
106106
}
107107

108108
public EventTypeAndInterrupt consumeAndBreakOnInterrupt(EventConsumer consumer, boolean blocking) throws JSONRPCError {
109-
return consumeAndBreakOnInterrupt(consumer, blocking, null, null);
110-
}
111-
112-
public EventTypeAndInterrupt consumeAndBreakOnInterrupt(EventConsumer consumer, boolean blocking, Runnable eventCallback) throws JSONRPCError {
113-
return consumeAndBreakOnInterrupt(consumer, blocking, eventCallback, null);
114-
}
115-
116-
public EventTypeAndInterrupt consumeAndBreakOnInterrupt(EventConsumer consumer, boolean blocking, Runnable eventCallback, CompletableFuture<Void> agentFuture) throws JSONRPCError {
117109
Flow.Publisher<EventQueueItem> allItems = consumer.consumeAll();
118110
AtomicReference<Message> message = new AtomicReference<>();
119111
AtomicBoolean interrupted = new AtomicBoolean(false);

transport/jsonrpc/src/test/java/io/a2a/transport/jsonrpc/handler/JSONRPCHandlerTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,9 +1244,7 @@ public void testOnMessageSendErrorHandling() {
12441244
new UnsupportedOperationError())
12451245
.when(mock).consumeAndBreakOnInterrupt(
12461246
Mockito.any(EventConsumer.class),
1247-
Mockito.anyBoolean(),
1248-
Mockito.any(),
1249-
Mockito.any());
1247+
Mockito.anyBoolean());
12501248
})){
12511249
response = handler.onMessageSend(request, callContext);
12521250
}

0 commit comments

Comments
 (0)