]> git.basschouten.com Git - openhab-addons.git/commitdiff
[googletts] Avoid UnsupportedOperationException during dispose (#15305)
authorlolodomo <lg.hc@free.fr>
Tue, 25 Jul 2023 21:54:31 +0000 (23:54 +0200)
committerGitHub <noreply@github.com>
Tue, 25 Jul 2023 21:54:31 +0000 (23:54 +0200)
Fix #15303

It is not allowed to clear an unmodified hash set.

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/GoogleTTSService.java

index d03e72c8d0d2ef09bfb048bf51e18415a4a159ac..13810f78bc63ea716cd38493cdc48f49bdfeec90 100644 (file)
@@ -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<>();
     }
 
     /**