You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 6, 2023. It is now read-only.
The jrubyscripting bundle that shipped with openhab 3.2 contains a bug where Openhab injected global scope which contains java classes. As a result, they are not usable in JRuby, unless the classes are re-imported. This in turns breaks rules that don't use openhab-jruby helper library.
The openhab-jruby helper library re-imports most of the relevant classes which masked the problem.
In December 2021, a new PR made it into the release of Openhab 3.2 which added ZonedDateTime, Duration and ChronoUnit. This caused problems in rules that use those java classes without re-importing them.
I found out why I was having problems with ZonedDateTime out of a sudden, as described in #438, although it isn't related to the original issue in #438.
The jrubyscripting bundle that shipped with openhab 3.2 contains a bug where Openhab injected global scope which contains java classes. As a result, they are not usable in JRuby, unless the classes are re-imported. This in turns breaks rules that don't use openhab-jruby helper library.
The openhab-jruby helper library re-imports most of the relevant classes which masked the problem.
In December 2021, a new PR made it into the release of Openhab 3.2 which added ZonedDateTime, Duration and ChronoUnit. This caused problems in rules that use those java classes without re-importing them.
I made a patch to the jrubyscripting bundle to intercept the objects / classes and replace them with a jruby class. This jar file can be used for testing:
https://github.com/jimtng/openhab-addons/raw/jruby-scope/bundles/org.openhab.automation.jrubyscripting/org.openhab.automation.jrubyscripting-3.2.0-SNAPSHOT.jar
The source code can be found here:
https://github.com/jimtng/openhab-addons/blob/jruby-scope/bundles/org.openhab.automation.jrubyscripting/src/main/java/org/openhab/automation/jrubyscripting/internal/JRubyScriptEngineFactory.java
I'll clean it up before submitting a PR to openhab-addons.
Originally posted by @jimtng in #448 (comment)
The text was updated successfully, but these errors were encountered: