Null-Safety-Warnungen der IDE behoben: Methodenreferenzen durch Lambdas ersetzt
Bei einer Methodenreferenz wird der Empfänger zum Parameter des funktionalen Interfaces, dessen @NonNull-Annotation die Eclipse-Analyse nicht zusichern kann; als Lambda übernimmt der Parameter die Annotation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -86,7 +86,7 @@ public class WebhookService {
|
|||||||
@PreDestroy
|
@PreDestroy
|
||||||
void shutdown() {
|
void shutdown() {
|
||||||
heartbeat.shutdownNow();
|
heartbeat.shutdownNow();
|
||||||
subscribers.forEach(SseEmitter::complete);
|
subscribers.forEach(emitter -> emitter.complete());
|
||||||
subscribers.clear();
|
subscribers.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -359,7 +359,8 @@ public class SwyxTrayMockHandler extends TextWebSocketHandler {
|
|||||||
String needle = wanted.toLowerCase();
|
String needle = wanted.toLowerCase();
|
||||||
List<MockContact> hits = MOCK_CONTACTS.stream()
|
List<MockContact> hits = MOCK_CONTACTS.stream()
|
||||||
.filter(contact -> contact.matches(needle))
|
.filter(contact -> contact.matches(needle))
|
||||||
.sorted(Comparator.comparing(MockContact::name).thenComparing(MockContact::number))
|
.sorted(Comparator.comparing((MockContact contact) -> contact.name())
|
||||||
|
.thenComparing(contact -> contact.number()))
|
||||||
.limit(CONTACT_RESULT_LIMIT)
|
.limit(CONTACT_RESULT_LIMIT)
|
||||||
.toList();
|
.toList();
|
||||||
log.info("SwyxTray-Mock: {} Adresseintrag/-einträge zu '{}'", hits.size(), wanted);
|
log.info("SwyxTray-Mock: {} Adresseintrag/-einträge zu '{}'", hits.size(), wanted);
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class AddressEntryTests {
|
|||||||
"type":"addresses"}""");
|
"type":"addresses"}""");
|
||||||
|
|
||||||
assertThat(entries).hasSize(2);
|
assertThat(entries).hasSize(2);
|
||||||
assertThat(entries).extracting(AddressEntry::number).containsExactly("7587", "5215");
|
assertThat(entries).extracting(entry -> entry.number()).containsExactly("7587", "5215");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
|||||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||||
|
|
||||||
import de.appcreation.swyxweb.storage.ArchiveService;
|
import de.appcreation.swyxweb.storage.ArchiveService;
|
||||||
import de.appcreation.swyxweb.webhook.WebhookEvent;
|
|
||||||
import de.appcreation.swyxweb.webhook.WebhookService;
|
import de.appcreation.swyxweb.webhook.WebhookService;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Nested;
|
import org.junit.jupiter.api.Nested;
|
||||||
@@ -112,7 +111,7 @@ class WebhookControllerTests {
|
|||||||
.andExpect(status().isOk());
|
.andExpect(status().isOk());
|
||||||
|
|
||||||
assertThat(service.history())
|
assertThat(service.history())
|
||||||
.extracting(WebhookEvent::channel)
|
.extracting(event -> event.channel())
|
||||||
.containsExactly("kunden", "kuriere", "jobs");
|
.containsExactly("kunden", "kuriere", "jobs");
|
||||||
|
|
||||||
// Kunden und Kuriere landen als Adressdaten in der Ablage, der Job als Job.
|
// Kunden und Kuriere landen als Adressdaten in der Ablage, der Job als Job.
|
||||||
|
|||||||
Reference in New Issue
Block a user