1919import io .opentelemetry .api .trace .Span ;
2020import java .nio .ByteBuffer ;
2121import java .util .Collection ;
22+ import java .util .Objects ;
2223import java .util .function .Function ;
2324import java .util .stream .Collectors ;
2425
@@ -425,9 +426,10 @@ void checkEntryHeader(CallEntryMessage expected, MessageLite actual) throws Prot
425426 }
426427 CallEntryMessage actualInvoke = (CallEntryMessage ) actual ;
427428
428- if (!(expected .getServiceName ().equals (actualInvoke .getServiceName ())
429- && expected .getHandlerName ().equals (actualInvoke .getHandlerName ())
430- && expected .getParameter ().equals (actualInvoke .getParameter ()))) {
429+ if (!(Objects .equals (expected .getServiceName (), actualInvoke .getServiceName ())
430+ && Objects .equals (expected .getHandlerName (), actualInvoke .getHandlerName ())
431+ && Objects .equals (expected .getParameter (), actualInvoke .getParameter ())
432+ && Objects .equals (expected .getKey (), actualInvoke .getKey ()))) {
431433 throw ProtocolException .entryDoesNotMatch (expected , actualInvoke );
432434 }
433435 }
@@ -452,11 +454,11 @@ public Result<R> parseCompletionResult(CompletionMessage actual) {
452454 }
453455 }
454456
455- static final class BackgroundInvokeEntry extends JournalEntry <OneWayCallEntryMessage > {
457+ static final class OneWayCallEntry extends JournalEntry <OneWayCallEntryMessage > {
456458
457- static final BackgroundInvokeEntry INSTANCE = new BackgroundInvokeEntry ();
459+ static final OneWayCallEntry INSTANCE = new OneWayCallEntry ();
458460
459- private BackgroundInvokeEntry () {}
461+ private OneWayCallEntry () {}
460462
461463 @ Override
462464 public void trace (OneWayCallEntryMessage expected , Span span ) {
@@ -477,7 +479,17 @@ String getName(OneWayCallEntryMessage expected) {
477479 @ Override
478480 void checkEntryHeader (OneWayCallEntryMessage expected , MessageLite actual )
479481 throws ProtocolException {
480- Util .assertEntryEquals (expected , actual );
482+ if (!(actual instanceof OneWayCallEntryMessage )) {
483+ throw ProtocolException .entryDoesNotMatch (expected , actual );
484+ }
485+ OneWayCallEntryMessage actualInvoke = (OneWayCallEntryMessage ) actual ;
486+
487+ if (!(Objects .equals (expected .getServiceName (), actualInvoke .getServiceName ())
488+ && Objects .equals (expected .getHandlerName (), actualInvoke .getHandlerName ())
489+ && Objects .equals (expected .getParameter (), actualInvoke .getParameter ())
490+ && Objects .equals (expected .getKey (), actualInvoke .getKey ()))) {
491+ throw ProtocolException .entryDoesNotMatch (expected , actualInvoke );
492+ }
481493 }
482494 }
483495
0 commit comments