From: lolodomo Date: Tue, 25 Jul 2023 21:54:31 +0000 (+0200) Subject: [googletts] Avoid UnsupportedOperationException during dispose (#15305) X-Git-Url: https://git.basschouten.com/?a=commitdiff_plain;h=6dccbcb0050d257648a249e36446e964e9af2684;p=openhab-addons.git [googletts] Avoid UnsupportedOperationException during dispose (#15305) Fix #15303 It is not allowed to clear an unmodified hash set. Signed-off-by: Laurent Garnier --- 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 d03e72c8d0..13810f78bc 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<>(); } /**