Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
szysas committed Aug 26, 2024
1 parent b64c1f7 commit b914623
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ public CoapServerBuilder maxIncomingBlockTransferSize(int size) {
}

private PutOnlyMap<CoapRequestId, CoapPacket> getOrCreateDuplicateDetectorCache(ScheduledExecutorService scheduledExecutorService) {
if (duplicateDetectionCache == null) {
duplicateDetectionCache = new DefaultDuplicateDetectorCache("Default cache", duplicationMaxSize, scheduledExecutorService);
if (duplicateDetectionCache != null) {
return duplicateDetectionCache;

Check warning on line 142 in coap-core/src/main/java/com/mbed/coap/server/CoapServerBuilder.java

View check run for this annotation

Codecov / codecov/patch

coap-core/src/main/java/com/mbed/coap/server/CoapServerBuilder.java#L142

Added line #L142 was not covered by tests
}
return duplicateDetectionCache;
return new DefaultDuplicateDetectorCache("Default cache", duplicationMaxSize, scheduledExecutorService);
}

private CapabilitiesResolver capabilities() {
Expand Down Expand Up @@ -208,7 +208,7 @@ public CoapServerBuilder requestTagSupplier(RequestTagSupplier requestTagSupplie
}

public CoapServer build() {
requireNonNull(coapTransport, "Missing transport");
CoapTransport coapTransport = requireNonNull(this.coapTransport, "Missing transport");
final boolean stopExecutor = scheduledExecutorService == null;
final ScheduledExecutorService effectiveExecutorService = scheduledExecutorService != null ? scheduledExecutorService : Executors.newSingleThreadScheduledExecutor();
Timer timer = toTimer(effectiveExecutorService);
Expand Down

0 comments on commit b914623

Please sign in to comment.