diff --git a/bundles/org.openhab.core.voice/src/main/java/org/openhab/core/voice/AbstractCachedTTSService.java b/bundles/org.openhab.core.voice/src/main/java/org/openhab/core/voice/AbstractCachedTTSService.java index 0582b9548..9ce51a15f 100644 --- a/bundles/org.openhab.core.voice/src/main/java/org/openhab/core/voice/AbstractCachedTTSService.java +++ b/bundles/org.openhab.core.voice/src/main/java/org/openhab/core/voice/AbstractCachedTTSService.java @@ -30,15 +30,15 @@ import org.osgi.service.component.annotations.Reference; @NonNullByDefault public abstract class AbstractCachedTTSService implements CachedTTSService { - private TTSCache ttsCache; + private final TTSCache ttsCache; - @Override - public final AudioStream synthesize(String text, Voice voice, AudioFormat requestedFormat) throws TTSException { - return ttsCache.get(this, text, voice, requestedFormat); + public AbstractCachedTTSService(final @Reference TTSCache ttsCache) { + this.ttsCache = ttsCache; } - public AbstractCachedTTSService(@Reference TTSCache ttsCache) { - this.ttsCache = ttsCache; + @Override + public AudioStream synthesize(String text, Voice voice, AudioFormat requestedFormat) throws TTSException { + return ttsCache.get(this, text, voice, requestedFormat); } @Override