Fix a few SAT findings (#2936)

Signed-off-by: Wouter Born <github@maindrain.net>
pull/2944/head
Wouter Born 2022-04-27 23:09:37 +02:00 committed by GitHub
parent 13d2edb43e
commit 8f7db68d1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View File

@ -157,11 +157,14 @@ public class JavaSoundAudioSource implements AudioSource {
if (openStreamRefs.contains(output)) {
output.flush();
}
} catch (IOException e) {
if (e instanceof InterruptedIOException && openStreamRefs.isEmpty()) {
} catch (InterruptedIOException e) {
if (openStreamRefs.isEmpty()) {
// task has been ended while writing
return;
}
logger.warn("InterruptedIOException while writing to source pipe: {}",
e.getMessage());
} catch (IOException e) {
logger.warn("IOException while writing to source pipe: {}", e.getMessage());
} catch (RuntimeException e) {
logger.warn("RuntimeException while writing to source pipe: {}", e.getMessage());

View File

@ -146,7 +146,6 @@ public class ScriptTransformationService
if (splitString.length != 2) {
logger.warn("Parameter '{}' does not consist of two parts for configuration UID {}, skipping.",
param, scriptUid);
} else {
executionContext.setAttribute(splitString[0], splitString[1], ScriptContext.ENGINE_SCOPE);
}

View File

@ -49,7 +49,6 @@ import org.openhab.core.transform.TransformationException;
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.LENIENT)
public class ScriptTransformationServiceTest {
private static final String COMPILABLE_SCRIPT_TYPE = "compilableScript";
private static final String SCRIPT_TYPE = "script";
private static final String SCRIPT_UID = "scriptUid";
private static final String SCRIPT = "script";