Simplify switch statements, Java 21 (#5012)

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
Holger Friedrich
2025-09-07 19:54:05 +02:00
committed by GitHub
parent adfa286a3a
commit 81e3a05614
14 changed files with 74 additions and 118 deletions
@@ -176,13 +176,10 @@ public class CommunicationManagerOSGiTest extends JavaOSGiTest {
itemStateConverterMock, eventPublisherMock, safeCaller, thingRegistryMock);
doAnswer(invocation -> {
switch (((Channel) invocation.getArguments()[0]).getKind()) {
case STATE:
return new ProfileTypeUID("test:state");
case TRIGGER:
return new ProfileTypeUID("test:trigger");
}
return null;
return switch (((Channel) invocation.getArguments()[0]).getKind()) {
case STATE -> new ProfileTypeUID("test:state");
case TRIGGER -> new ProfileTypeUID("test:trigger");
};
}).when(profileAdvisorMock).getSuggestedProfileTypeUID(isA(Channel.class), isA(String.class));
doAnswer(invocation -> {
switch (((ProfileTypeUID) invocation.getArguments()[0]).toString()) {