From fdb10451ecffed8ff156899bdd4975f130761fdf Mon Sep 17 00:00:00 2001 From: lolodomo Date: Tue, 25 Jul 2023 23:54:31 +0200 Subject: [PATCH] [googletts] Avoid UnsupportedOperationException during dispose (#15305) Fix #15303 It is not allowed to clear an unmodified hash set. Signed-off-by: Laurent Garnier --- .../openhab/voice/googletts/internal/GoogleTTSService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/GoogleTTSService.java b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/GoogleTTSService.java index d03e72c8d0d..13810f78bc6 100644 --- a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/GoogleTTSService.java +++ b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/GoogleTTSService.java @@ -136,8 +136,8 @@ public class GoogleTTSService extends AbstractCachedTTSService { @Deactivate protected void dispose() { apiImpl.dispose(); - audioFormats.clear(); - allVoices.clear(); + audioFormats = new HashSet<>(); + allVoices = new HashSet<>(); } /**