Skip to content

Commit 9fea1c5

Browse files
committed
[jsscripting] Use OPENHAB_TRANSFORMATION_SCRIPT constant from core
Signed-off-by: Florian Hotze <[email protected]>
1 parent 89779a1 commit 9fea1c5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

bundles/org.openhab.automation.jsscripting/src/main/java/org/openhab/automation/jsscripting/internal/DebuggingGraalScriptEngine.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import org.slf4j.Logger;
2626
import org.slf4j.LoggerFactory;
2727

28+
import static org.openhab.core.automation.module.script.ScriptTransformationService.OPENHAB_TRANSFORMATION_SCRIPT;
29+
2830
/**
2931
* Wraps ScriptEngines provided by Graal to provide error messages and stack traces for scripts.
3032
*
@@ -34,7 +36,6 @@
3436
class DebuggingGraalScriptEngine<T extends ScriptEngine & Invocable & AutoCloseable>
3537
extends InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable<T> {
3638

37-
private static final String SCRIPT_TRANSFORMATION_ENGINE_IDENTIFIER = "openhab-transformation-script-";
3839
private static final int STACK_TRACE_LENGTH = 5;
3940

4041
private @Nullable Logger logger;
@@ -91,8 +92,8 @@ private void initializeLogger() {
9192
} else if (ruleUID != null) {
9293
identifier = ruleUID.toString();
9394
} else if (ohEngineIdentifier != null) {
94-
if (ohEngineIdentifier.toString().startsWith(SCRIPT_TRANSFORMATION_ENGINE_IDENTIFIER)) {
95-
identifier = ohEngineIdentifier.toString().replaceAll(SCRIPT_TRANSFORMATION_ENGINE_IDENTIFIER,
95+
if (ohEngineIdentifier.toString().startsWith(OPENHAB_TRANSFORMATION_SCRIPT)) {
96+
identifier = ohEngineIdentifier.toString().replaceAll(OPENHAB_TRANSFORMATION_SCRIPT,
9697
"transformation.");
9798
}
9899
}

0 commit comments

Comments
 (0)