Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jsscripting] Extend synchronization to common ScriptEngine methods #13924

Merged
merged 11 commits into from
Dec 14, 2022

Conversation

florian-h05
Copy link
Contributor

@florian-h05 florian-h05 commented Dec 12, 2022

Description

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable class.
The synchronization mechanism changed from using synchronized to using a ReentrantLock together with catch_finally to avoid having deadlocks when an exception is thrown.
Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

Testing

I've tested this (see https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/150), I've also verified on my production system that this does not cause any issues with rules and timers.

/cc @ccutrer @cweitkamp @J-N-K

The pull request should be built automatically and available at:
https://openhab.jfrog.io/artifactory/libs-pullrequest-local/org/openhab/addons/bundles/org.openhab.automation.jsscripting/3.4.0-SNAPSHOT/org.openhab.automation.jsscripting-3.4.0-SNAPSHOT.jar

@florian-h05 florian-h05 added the bug An unexpected problem or unintended behavior of an add-on label Dec 12, 2022
@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/150

Copy link
Contributor

@ccutrer ccutrer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seem simple enough to me. Move the lock up to a parent class, and have it cover more entry points. I'm not familiar enough with the the entire hierarchy of script engines here though, so this is a weak approval at best.

@florian-h05
Copy link
Contributor Author

florian-h05 commented Dec 12, 2022

@jpg0 Can you please have a look at this? This is urgent since the code freeze will come on Friday evening.

I know that you might not like the synchronization inside DelegatingScriptEngineWithInvocableAndAutocloseable, but for me this seemed to be the best place, because:

  • InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable was no option to me since it is there for

    interception of calls, either before Invocation, or upon a ScriptException being thrown.

  • OpenhabGraalJSScriptEngine: the place where you wanted me to put the synchronization for invokeFunction, but adding the overrides with the synchronization logic here makes it unnecessarily “puffed up” IMO.
  • DelegatingScriptEngineWithInvocableAndAutocloseable is there to Allow overriding of specific methods., which is exactly what we need here.

@jpg0
Copy link
Contributor

jpg0 commented Dec 12, 2022

You are correct that DelegatingScriptEngineWithInvocableAndAutocloseable is there to allow overriding of methods. But it is not there to add specific functionality itself, rather to make it easy for other classes to do so.

The way these delegates work is my providing the 'template' for implementors to add the functionality. Their responsibility is providing 'hooks' for implementors to use. In this case one option would be to subclass the delegate and add your specific functionality to the subclass. Another would be to create an additional delegate type which wraps this delegate - you could even do this with a dynamic proxy if you just wanted to synchronise every method.

The reason that I am against adding it to the delegate itself is that the purpose of the delegate is to create a separation from target class (the script engine) to specific behaviour you want added in other classes. If you start putting the specific behaviour in the delegate itself, then there is no longer any separation anyway, so the purpose of the class existing is lost.

Also if you look in the openhab-core codebase you will see many DelegatingXXX classes. These all behave in exactly the same way, because a delegate is a design pattern that works this way and this makes it easy for developers to immediately understand what the class does.

@florian-h05
Copy link
Contributor Author

@jpg0 So you are proposing to add another delegate class?
What do you think is the “best” approach of the three you described?

@jpg0
Copy link
Contributor

jpg0 commented Dec 12, 2022

Looking at it again, the best way to do this is to subclass the InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable - this is already designed to intercept all calls. You would need to add an afterInvocation to release the lock though (I never did this as I didn't have a need for it, but it's a common pattern).

The only problem is that you would need to switch to explicit use of a ReentrantLock rather than use of the synchronized keyword. TBH this is probably not a bad idea anyway as we are already going fairly deep on synchronisation here and this will give you more options.

@jpg0
Copy link
Contributor

jpg0 commented Dec 12, 2022

(Oh and if the previous suggestion is too complex for you, I'd also support just subclassing DelegatingScriptEngineWithInvocableAndAutocloseable and adding the synchronisation in the subclass.)

@florian-h05
Copy link
Contributor Author

florian-h05 commented Dec 12, 2022

You would need to add an afterInvocation to release the lock though

Also to OpenhabGraalJSScriptEngine?
So lock in beforeInvocation and unlock in afterInvocation then?

I’ve also seen that in InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable, beforeInvocation and the ScriptEngine method (e.g. eval) is called inside try catch, afterInvocation should best be called after the try catch, otherwise a failed execution would cause a deadlock, correct?

IMO, if I implement unlocking in afterInvocation in OpenhabGraalJSScriptEngine, I'd just need to add the afterInvocation method to InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable without subclassing it.

@jpg0
Copy link
Contributor

jpg0 commented Dec 12, 2022

Also to OpenhabGraalJSScriptEngine?

No, this doesn't need it, unless you want to put the synchronisation into it directly (and then wouldn't need a subclass).

So lock in beforeInvocation and unlock in afterInvocation then?

Yes. You don't need to call afterInvocation after the catch, as long as you also release the lock in afterThrowsInvocation. It's more typical this way (so that afterInvocation is not called upon exception).

@florian-h05
Copy link
Contributor Author

I think I will put the synchronizatuon logic directly into the OpenhabGraalJSScriptEngine since until now synchronization was also provided inside it.

You don't need to call afterInvocation after the catch, as long as you also release the lock in afterThrowsInvocation. It's more typical this way (so that afterInvocation is not called upon exception).

Don't I need to call afterInvocation in the finally block to unlock the lock if the try succeeds and if it fails?

@jpg0
Copy link
Contributor

jpg0 commented Dec 12, 2022

Don't I need to call afterInvocation in the finally block to unlock the lock if the try succeeds and if it fails?

You need to lock in before, then unlock in both after and afterThrows (only one should get called).

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the DelegatingScriptEngineWithInvocableAndAutocloseableAndSynchronization class. Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

Signed-off-by: Florian Hotze <[email protected]>
…ethods"

This reverts commit aadd21e.

Signed-off-by: Florian Hotze <[email protected]>
… Switch to ReentrantLock

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable class.
The synchronization mechanism changed from using synchronized to using a ReentrantLock together with catch_finally to avoid having deadlocks when an exception is thrown.
Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

Signed-off-by: Florian Hotze <[email protected]>
@florian-h05 florian-h05 force-pushed the jsscripting-extend-synchronization branch from 1d3867f to 3e8bbda Compare December 12, 2022 21:21
@florian-h05
Copy link
Contributor Author

florian-h05 commented Dec 12, 2022

@jpg0 Can you please have a look at my current implementation? See 3e8bbda.

@J-N-K Can you please have a look at my null annotations changes/compiler warnings reducal? See e9708bb.

@jpg0
Copy link
Contributor

jpg0 commented Dec 12, 2022

You have put afterInvocation in a finally block meaning that it's called even when an exception is thrown. This is non -standard for interception code like this, plus prevents consumers hooking non-exception invocations only. Better is to keep inside the try block so that it's not called upon exception and ensure that the implementor also overrides afterException to release the lock in this case.

The locking code does lgtm though and will work.

@florian-h05
Copy link
Contributor Author

Putting afterInvocation inside the try block wouldn’t work (if I’m wrong please correct me), since it would need to come after the return statement:

    @Override
    public Object eval(String s, ScriptContext scriptContext) throws ScriptException {
        try {
            beforeInvocation();
             return super.eval(s, scriptContext);
            // afterInvocation wouldn’t work here
         } catch (ScriptException se) {
             throw afterThrowsInvocation(se);
         } finally { // Make sure that Lock is unlocked regardless of an exception is thrown or not to avoid deadlocks
             afterInvocation();
         }
     }

The only possible option is to store the result of eval in a local var, then call afterInvocation and then return the local var. I’m not sure if that would change the behaviour of the script engine or not, I’m no ScriptEngine expert.

@jpg0
Copy link
Contributor

jpg0 commented Dec 13, 2022

I would do it this way:

@Override
    public Object eval(String s, ScriptContext scriptContext) throws ScriptException {
        try {
            beforeInvocation();
            return afterInvocation(super.eval(s, scriptContext));
         } catch (ScriptException se) {
             throw afterThrowsInvocation(se);
         }
     }

Then you get the added benefit that subclasses can modify or wrap the return value if they wish. (afterInvocation would accept and return an Object, and may require casting in some cases).

You can also use a local variable if you like; it shouldn't affect the delegate, regardless of whether it's a script engine or anything else.

@florian-h05
Copy link
Contributor Author

@jpg0 Can you please have a look at my commit 7b7e01f?

From my side this only needs some testing and then can be merged.

Copy link
Member

@J-N-K J-N-K left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one comment: According to https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/locks/Lock.html the pattern for locks should be

lock.lock();
try {
    // do something
} finally {
    lock.unlock();
}

while you use

try {
    lock.lock();
    // do something
} finally {
    lock.unlock();
}

Since we usually use the first, it would be preferable to use that.

@jpg0
Copy link
Contributor

jpg0 commented Dec 13, 2022

@jpg0 Can you please have a look at my commit 7b7e01f?

Looks good, only change would be to remove the left-over parameterless afterInvocation.

@florian-h05
Copy link
Contributor Author

@J-N-K I‘ve addressed your review comment (not pushed yet).

But I found a deadlock due to a NoSuchMethodException being thrown. I already have a fix, but I have to keep afterInvocation since it universally allows us to unlock the lock without passing or returning an argument, e.g. in case we need to handle an exception that is no ScriptException. @jpg0 So I’ll keep the parameter-less afterInvocation.

I will try to finish this this evening, would be nice if we could get this merged before the next SNAPSHOT.

@jlaur Are you available?

@jpg0
Copy link
Contributor

jpg0 commented Dec 13, 2022

So I’ll keep the parameter-less afterInvocation.

Don't do this, just make sure that the catch is wide enough that everything is caught: catch Throwable.

@jlaur
Copy link
Contributor

jlaur commented Dec 13, 2022

@florian-h05 - I'll be available in the evening, if you need an addon maintainer for merging. However, I don't know how much time I will have for reviewing this and also don't feel comfortable in this area, so I would suggest approval from @jpg0 and/or @J-N-K first. @kaikreuzer, keeping you in the loop also as this seems like an important fix, but probably also with some risk.

…le interface methods

During testing my latest changes, I noticed that there is a deadlock when invokeFunction or invokeMethod are called on a non-existing method.
This happens because the NoSuchMethodException keeps afterInvocation from running and therefore the lock never gets released.

Signed-off-by: Florian Hotze <[email protected]>
@florian-h05
Copy link
Contributor Author

Commit e17f869 resolves:

Commit 87af8e7 fixes the deadlock I was talking about in #13924 (comment).

I have tested this on my dev system and also on my production system (with about 70 JS rules using timers and multiple triggers), works fine 👍

@J-N-K Can you please review?
@jpg0 feel free to also have a look, but your comment about the parameter-less afterInvocation is addressed (I removed it as asked) and the other changes are minimal.

@@ -116,6 +113,10 @@ public Object invokeMethod(Object o, String s, Object... objects) throws ScriptE
return afterInvocation(super.invokeMethod(o, s, objects));
} catch (ScriptException se) {
throw afterThrowsInvocation(se);
} catch (NoSuchMethodException e) { // Make sure to unlock on a NoSuchMethodException to avoid deadlocks
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @jpg0 mentioned: if you catch Throwable we are sure that the lock is always removed. (Also below) Otherwise LGTM.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And then rethrow it? The method expects a return statement, so I either need to return something or throw something. If I want to rethrow it, I need to add throws Throwable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@J-N-K
I've fixed this in 2506015, but since I cannot throw a general Exception from these methods since that would clash with Invocable.invokeMethod and Invoke.invokeFunction, I handle all exceptions (except NPEs because SAT fails then) that can be thrown from these two methods.

And, I always need to return a value.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor Author

@florian-h05 florian-h05 Dec 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@J-N-K
Can you please then add an approving review so we can ping @jlaur for merging?

I think we don't need to wait for @jpg0 since his concerns were addressed and the other changes are exception handling which is nothing GraalJSScriptEngine specific.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jpg0
See 8a6834d, I hope this is the final commit ;-)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost :-/

You updated the exception type, but didn't make the switch from afterInvocation to afterThrowsInvocation.

Copy link
Contributor Author

@florian-h05 florian-h05 Dec 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jpg0
See 3140f02.
I think I linked the wrong commit.

Maybe just have a look at the full change: https://github.com/openhab/openhab-addons/pull/13924/files.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, I see now. Great! There are two other issues*, but maybe we should look at them another time; I don't want to hold this up any longer and they are not things that are hard to change later.

  • the are other methods which just cast the return of afterThrowsInvocationto ScriptException rather than performing the type checks. These casts may fail. Best is probably to extract the type checks into a separate method which each of these methods use to extract the correct exception type to throw.
  • ideally the overriden implementation of afterThrowsInvocation should call super.afterThrowsInvocation(e) to get the exception to return, rather than using e directly, in case the parent class is also doing something with it.

Either way, let's get this merged!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I‘ve created issue #13950 as a reminder.

@J-N-K
Copy link
Member

J-N-K commented Dec 13, 2022

Either that, or catch Exception, I guess we‘ll have other sorts of issues if we run into an Error.

@florian-h05
Copy link
Contributor Author

florian-h05 commented Dec 13, 2022

@jlaur This is ready for merging now.

See #13924 (comment) and #13924 (comment).

Please have a look at commit df17c75, it should be fine.

@jlaur jlaur requested review from jpg0 and J-N-K and removed request for jpg0 December 14, 2022 15:56
@florian-h05
Copy link
Contributor Author

@jlaur Let‘s get this merged!
See the approval of J-N-K and jpg0‘s comment in #13924 (comment).

Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jlaur jlaur merged commit d4ec220 into openhab:main Dec 14, 2022
@jlaur jlaur added this to the 3.4 milestone Dec 14, 2022
@florian-h05 florian-h05 deleted the jsscripting-extend-synchronization branch December 14, 2022 19:16
florian-h05 added a commit to florian-h05/openhab-addons that referenced this pull request Dec 15, 2022
florian-h05 added a commit to florian-h05/openhab-addons that referenced this pull request Dec 15, 2022
morph166955 pushed a commit to morph166955/openhab-addons that referenced this pull request Dec 18, 2022
…penhab#13924)

* [jsscripting] Extend synchronization to common ScriptEngine methods

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the DelegatingScriptEngineWithInvocableAndAutocloseableAndSynchronization class. Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

* Revert "[jsscripting] Extend synchronization to common ScriptEngine methods"

This reverts commit aadd21e.

* [jsscripting] Extend synchronization to common ScriptEngine methods & Switch to ReentrantLock

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable class.
The synchronization mechanism changed from using synchronized to using a ReentrantLock together with catch_finally to avoid having deadlocks when an exception is thrown.
Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

* [jsscripting] Reduce compiler warnings
* [jsscripting] Replace finally blocks & Wrap returns in afterInvocation
* [jsscripting] Fix deadlock caused by NoSuchMethodException in Invocable interface methods

During testing my latest changes, I noticed that there is a deadlock when invokeFunction or invokeMethod are called on a non-existing method.
This happens because the NoSuchMethodException keeps afterInvocation from running and therefore the lock never gets released.

* [jsscripting] Also rethrow NPE & Fix PMD warnings/errors
* [jsscripting] Wrap and rethrow other exceptions instead of returning them
* [jsscripting] Address review comment from @jpg0

Signed-off-by: Florian Hotze <[email protected]>
Signed-off-by: Ben Rosenblum <[email protected]>
andrasU pushed a commit to andrasU/openhab-addons that referenced this pull request Dec 24, 2022
…penhab#13924)

* [jsscripting] Extend synchronization to common ScriptEngine methods

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the DelegatingScriptEngineWithInvocableAndAutocloseableAndSynchronization class. Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

* Revert "[jsscripting] Extend synchronization to common ScriptEngine methods"

This reverts commit aadd21e.

* [jsscripting] Extend synchronization to common ScriptEngine methods & Switch to ReentrantLock

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable class.
The synchronization mechanism changed from using synchronized to using a ReentrantLock together with catch_finally to avoid having deadlocks when an exception is thrown.
Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

* [jsscripting] Reduce compiler warnings
* [jsscripting] Replace finally blocks & Wrap returns in afterInvocation
* [jsscripting] Fix deadlock caused by NoSuchMethodException in Invocable interface methods

During testing my latest changes, I noticed that there is a deadlock when invokeFunction or invokeMethod are called on a non-existing method.
This happens because the NoSuchMethodException keeps afterInvocation from running and therefore the lock never gets released.

* [jsscripting] Also rethrow NPE & Fix PMD warnings/errors
* [jsscripting] Wrap and rethrow other exceptions instead of returning them
* [jsscripting] Address review comment from @jpg0

Signed-off-by: Florian Hotze <[email protected]>
Signed-off-by: Andras Uhrin <[email protected]>
andrewfg added a commit to andrewfg/openhab-addons that referenced this pull request Dec 27, 2022
commit 1df693a
Author: lsiepel <[email protected]>
Date:   Tue Dec 27 16:27:19 2022 +0100

    [bluetooth.am43] null annotations (openhab#13972)

    * null annotations forbidden package
    * improve createChecksum
    * spotless + typo

    Signed-off-by: lsiepel <[email protected]>

commit 8b1d0fc
Author: lsiepel <[email protected]>
Date:   Tue Dec 27 16:16:55 2022 +0100

    null annotations - checkstyle (openhab#13979)

    Signed-off-by: Leo Siepel <[email protected]>

commit df6454e
Author: lsiepel <[email protected]>
Date:   Tue Dec 27 16:13:12 2022 +0100

    minro checkstyle (openhab#13977)

    Signed-off-by: Leo Siepel <[email protected]>

commit 9687c3d
Author: Jiri Kraus <[email protected]>
Date:   Tue Dec 27 16:08:12 2022 +0100

    [velux] Updated Discovery instructions for scenes and actuators (openhab#14009)

    * Updated Discovery instructions for scenes and actuators

    Updated Discovery instructions as after KLF200 is auto discovered and configured discovery of scenes and actuators need to be manually triggered.

    * @jirikraus Updated Discovery instructions for scenes and actuators

    Formatting update to address comment from @andrewfg.

commit 35e930c
Author: lsiepel <[email protected]>
Date:   Tue Dec 27 12:56:43 2022 +0100

    [astro] Added moon phase precision (openhab#14067)

    * add more precision to MoonPhase.Age

    Signed-off-by: lsiepel <[email protected]>

commit 4a98295
Author: mlobstein <[email protected]>
Date:   Tue Dec 27 05:54:26 2022 -0600

    [nuvo] Auto update source channel for grouped zones (openhab#14012)

    * Auto update source channel for grouped zones

    Signed-off-by: Michael Lobstein <[email protected]>

commit e39e691
Author: Cody Cutrer <[email protected]>
Date:   Tue Dec 27 03:55:12 2022 -0700

    [homekit] support Rollershutter items for HoldPosition (openhab#14045)

    * [homekit] support Rollershutter items for HoldPosition

    just send STOP to them

    * [homekit] log a warning for incompatible HoldPosition items

    Signed-off-by: Cody Cutrer <[email protected]>

commit 0b59be6
Author: Jacob Laursen <[email protected]>
Date:   Tue Dec 27 11:41:59 2022 +0100

    Skip loading/migrating items with invalid name (openhab#14054)

    Fixes openhab#14053

    Signed-off-by: Jacob Laursen <[email protected]>

commit e7938ae
Author: Holger Friedrich <[email protected]>
Date:   Tue Dec 27 10:55:15 2022 +0100

    [rrd4j] Improve logging of exceptions thrown by getDB (openhab#14068)

    Add exception message for better identification of root cause.

    Signed-off-by: Holger Friedrich <[email protected]>

commit e5f30b1
Author: Tim Harper <[email protected]>
Date:   Tue Dec 27 02:25:28 2022 -0700

    [tplinksmarthome] Document sending raw commands to devices (openhab#14062)

    Signed-off-by: Tim Harper <[email protected]>

    Signed-off-by: Tim Harper <[email protected]>

commit 1c5b794
Author: lsiepel <[email protected]>
Date:   Mon Dec 26 17:00:53 2022 +0100

    [airvisualnode] Add null annotations (openhab#13895)

    * Add null annotation

    Signed-off-by: Leo Siepel <[email protected]>

commit 88c0b72
Author: Wouter Born <[email protected]>
Date:   Mon Dec 26 15:27:03 2022 +0100

    [jsscriptingnashorn] JavaScript Scripting Nashorn Automation  (openhab#14013)

    * [jsscriptingnashorn] JavaScript Scripting Nashorn Automation

    This add-on allows you to use your older JavaScript (ECMAScript 5.1) rules on newer Java versions until they are migrated to JavaScript (ECMAScript 2021+).
    The add-on uses a standalone [Nashorn Engine](https://github.com/openjdk/nashorn) which was part of Java until it was removed in Java 15.

    * Update parent to 3.4.0-SNAPSHOT and nashorn-core to 15.4

    For the Nashorn changelog, see:

    https://github.com/openjdk/nashorn/blob/main/CHANGELOG.md

    * Update parent to 4.0.0-SNAPSHOT
    * Remove removeUnsupportedNashornArgs
    * Update scriptTypes
    * Add CODEOWNERS entry
    * Recycle ScriptScopeOSGiTest.java

    It got removed in openhab/openhab-core#2994

    * Remove redundant new line from pom.xml

    Signed-off-by: Wouter Born <[email protected]>

commit 605574b
Author: Hilbrand Bouwkamp <[email protected]>
Date:   Mon Dec 26 10:17:42 2022 +0100

    Set openHAB to correct version in binding skeleton scripts. (openhab#14061)

    Signed-off-by: Hilbrand Bouwkamp <[email protected]>

commit 6cd59e4
Author: Jørgen Austvik <[email protected]>
Date:   Sun Dec 25 20:56:04 2022 +0100

    [nanoleaf] More robust caching of layout (openhab#13998)

    * [nanoleaf] More robust caching of layout

    This is a bugfix/enhancement to make sure the caching of the layout
    (to save it from being recalculated) works better:
    - Only save previous layout if indeed painted
    - Only save layout from the layout update, not the display state
    - Recalculate anyway if current state is null

    * Bugfix: Update colors

    When Stefan runs, the getBridge() returns null, when Jørgen runs, is doesn't. But it isn't needed, because we
    are already in the handler, so just call own methods.

    Improvement: Less draws when updating colors

    Instead of drawing the picture for each panel (which gave a cool effect), draw only once when we have parsed all color data.

    Signed-off-by: Jørgen Austvik <[email protected]>

commit 0357049
Author: Holger Friedrich <[email protected]>
Date:   Sat Dec 24 12:11:28 2022 +0100

    [knx] Fix SAT warnings (openhab#14052)

    Signed-off-by: Holger Friedrich <[email protected]>

commit f619798
Author: Cody Cutrer <[email protected]>
Date:   Fri Dec 23 16:00:57 2022 -0700

    [lifx] Handle and provide QuantityType for color-temperature-abs channel (openhab#14025)

    See openhab/openhab-core#3129

    Signed-off-by: Cody Cutrer <[email protected]>

commit b62e145
Author: Cody Cutrer <[email protected]>
Date:   Fri Dec 23 15:41:44 2022 -0700

    [homekit] Allow configuring secondary services as members of a group (openhab#13879)

    * [homekit] allow configuring secondary services as members of a group

    Required introduction of AccessoryGroup to represent the base
    AccessoryInformationService for ease of configuring multiple of the
    same service.

    This is also "breaking" in that someone who previously had HomeKit
    accessories nested directly inside of a group that was itself a
    HomeKit accessory will now have those items grouped within the Home
    app.

    * [homekit] combine multiple readme sections on complex accessories

    Signed-off-by: Cody Cutrer <[email protected]>

commit b1d4c40
Author: Wouter Born <[email protected]>
Date:   Fri Dec 23 14:10:58 2022 +0100

    Remove JavaScript Transformation pom.xml (openhab#14048)

    Everything except for this pom.xml got removed in openhab#13276

    Signed-off-by: Wouter Born <[email protected]>

commit 7c2d5dc
Author: Cody Cutrer <[email protected]>
Date:   Thu Dec 22 16:16:55 2022 -0700

    [homekit] implement List-Pairings method (openhab#13982)

    * [homekit] implement List-Pairings method
    * [homekit] fix listUsers() method
    * [homekit] bump HAP-java to 2.0.5

    refs openhab#13949

    Signed-off-by: Cody Cutrer <[email protected]>

commit fbf302e
Author: Wouter Born <[email protected]>
Date:   Fri Dec 23 00:13:17 2022 +0100

    Use HTTPS in pom.xml where possible (openhab#14044)

    Signed-off-by: Wouter Born <[email protected]>

commit 14c8b39
Author: Andreas Berger <[email protected]>
Date:   Thu Dec 22 21:17:07 2022 +0100

    [fineoffsetweatherstation] Fix QuantityType for rain-rate (openhab#14039)

    A community member realized, that the used unit for rain-rate was wrong (https://community.openhab.org/t/fine-offset-weather-station-binding-discussion/134167/153)
    Rain rate is measured in mm/h and so it is not a `VolumetricFlowRate` but a `Speed`.

    Additionally, I added some details to the doc.

    Signed-off-by: Andreas Berger <[email protected]>

commit af16d52
Author: Wouter Born <[email protected]>
Date:   Thu Dec 22 18:21:13 2022 +0100

    Fix "Hello, World!" examples in automation documentation (openhab#14041)

    The documentation states incorrectly that "Hello, World!" is printed when instead "Hello world!" is printed.

    Signed-off-by: Wouter Born <[email protected]>

commit 7195825
Author: lolodomo <[email protected]>
Date:   Thu Dec 22 18:17:15 2022 +0100

    [keba] Fix unit in example for power channel (openhab#14031)

    Related to openhab#12529

    Signed-off-by: Laurent Garnier <[email protected]>

commit 16fcd5d
Author: lsiepel <[email protected]>
Date:   Thu Dec 22 09:04:50 2022 +0100

    nul;l annotations and codestyle (openhab#13980)

    Signed-off-by: lsiepel <[email protected]>

commit fb31c14
Author: lsiepel <[email protected]>
Date:   Thu Dec 22 08:58:12 2022 +0100

    [bluetooth.govee] null annotations (openhab#13978)

    * null annotations and checkstyle
    * Fix more warnings

    Signed-off-by: lsiepel <[email protected]>

commit a079603
Author: Cody Cutrer <[email protected]>
Date:   Wed Dec 21 16:37:26 2022 -0700

    [homekit] allow configuring min/max light level (openhab#14034)

    since the default is weirdly 0.0001, yet my sensors can report a
    straight 0.

    Signed-off-by: Cody Cutrer <[email protected]>

commit 462dca8
Author: Cody Cutrer <[email protected]>
Date:   Wed Dec 21 16:31:05 2022 -0700

    [homekit] update AuthInfo objects when blockUserDeletion changes (openhab#14017)

    * [homekit] update AuthInfo objects when blockUserDeletion changes

    Signed-off-by: Cody Cutrer <[email protected]>

    * [homekit] general cleanup of redundant method call and unused local vars

    Signed-off-by: Cody Cutrer <[email protected]>

    Signed-off-by: Cody Cutrer <[email protected]>

commit 672b60b
Author: Cody Cutrer <[email protected]>
Date:   Wed Dec 21 14:43:46 2022 -0700

    [nanoleaf] Handle and provide QuantityType for color-temperature-abs channel (openhab#14026)

    * [nanoleaf] handle and provide QuantityType for color-temperature-abs channel

    see openhab/openhab-core#3129

    Signed-off-by: Cody Cutrer <[email protected]>

commit df8e0bb
Author: Cody Cutrer <[email protected]>
Date:   Wed Dec 21 12:21:53 2022 -0700

    [dali] tweak color temperature abs QuantityType fix (openhab#14029)

    adds an example of usage of the channel to the README, and
    simplifies one method call

    Signed-off-by: Cody Cutrer <[email protected]>

commit a0c2c76
Author: Christoph Weitkamp <[email protected]>
Date:   Wed Dec 21 20:10:21 2022 +0100

    [hue] Allow handling of QuantityType for color temperature channel (openhab#14024)

    * Allow handling of QuantityType for color temperature channel
    * Fixed log messages and reduce log level.

    Signed-off-by: Christoph Weitkamp <[email protected]>

commit 528140d
Author: Christoph Weitkamp <[email protected]>
Date:   Wed Dec 21 17:24:57 2022 +0100

    [darksky] Remove DarkSky binding due to EOL of their API (openhab#13037)

    * Remove DarkSky binding due to EOL of their API

    Signed-off-by: Christoph Weitkamp <[email protected]>

commit 324483d
Author: Cody Cutrer <[email protected]>
Date:   Tue Dec 20 13:15:10 2022 -0700

    [dali] handle and provide QuantityType for color-temperature-abs channel (openhab#14021)

    see openhab/openhab-core#3129

    Signed-off-by: Cody Cutrer <[email protected]>

commit 4d98cca
Author: Florian Hotze <[email protected]>
Date:   Tue Dec 20 09:15:43 2022 +0100

    [jsscripting] Minor fixes & improvements (openhab#13960)

    * [jsscripting] Correct wrong `createScriptEngine` implementation
    * [jsscripting] Also unlock lock on unexpected exceptions (rethrow them)
    * [jsscripting] Call super methods from their overrides
    * [jsscripting] Move superclass call of `beforeInvocation`

    Signed-off-by: Florian Hotze <[email protected]>

commit cd9e1b0
Author: J-N-K <[email protected]>
Date:   Tue Dec 20 08:11:31 2022 +0100

    Fix build / Resolve itests (openhab#14018)

    * Fix build / Resolve itests
    * Remove Java 11 from GHA matrix

    Also-by: Wouter Born <[email protected]>
    Signed-off-by: Jan N. Klug <[email protected]>

commit 0b1eb2c
Author: lsiepel <[email protected]>
Date:   Tue Dec 20 00:06:52 2022 +0100

    null annotations (openhab#13976)

    Signed-off-by: Leo Siepel <[email protected]>

commit 1519cb4
Author: lsiepel <[email protected]>
Date:   Tue Dec 20 00:04:43 2022 +0100

    nul annotations, checkstyle, forbidden packagel (openhab#13981)

    Signed-off-by: lsiepel <[email protected]>

commit 40b8b77
Author: lsiepel <[email protected]>
Date:   Tue Dec 20 00:01:50 2022 +0100

    Very minor checkstyle (openhab#13973)

    Signed-off-by: Leo Siepel <[email protected]>

commit 127f998
Author: Jacob Laursen <[email protected]>
Date:   Mon Dec 19 23:49:51 2022 +0100

    Upgrade MySQL Connector/J to 8.0.31 (openhab#13991)

    Signed-off-by: Jacob Laursen <[email protected]>

commit 3bec273
Author: Holger Friedrich <[email protected]>
Date:   Mon Dec 19 22:58:43 2022 +0100

    [rrd4j] Upgrade base library from 3.8.1 to 3.8.2 (openhab#13956)

    Signed-off-by: Holger Friedrich <[email protected]>

commit 3aefefb
Author: Holger Friedrich <[email protected]>
Date:   Mon Dec 19 22:49:40 2022 +0100

    [knx] Upgrade Calimero library to release 2.5.1 (openhab#14015)

    Signed-off-by: Holger Friedrich <[email protected]>

commit 9f3b8e1
Author: J-N-K <[email protected]>
Date:   Mon Dec 19 20:39:42 2022 +0100

    Raise minimum JDK version to 17 (openhab#13276)

    Signed-off-by: Jan N. Klug <[email protected]>

commit 4d6d644
Author: J-N-K <[email protected]>
Date:   Mon Dec 19 15:22:17 2022 +0100

    fix spotless after release (openhab#14014)

    Signed-off-by: Jan N. Klug <[email protected]>

commit 7993786
Author: openhab-bot <[email protected]>
Date:   Mon Dec 19 00:55:11 2022 +0000

    [unleash-maven-plugin] Preparation for next development cycle.

commit c5b68d0
Author: Jacob Laursen <[email protected]>
Date:   Sun Dec 18 23:22:40 2022 +0100

    Fix NullPointerException (openhab#14010)

    Fixes openhab#13961

    Signed-off-by: Jacob Laursen <[email protected]>

commit 4871d6d
Author: Wouter Born <[email protected]>
Date:   Sun Dec 18 19:50:23 2022 +0100

    [shelly] Remove broken images (openhab#14007)

    See also openhab#13993

    Signed-off-by: Wouter Born <[email protected]>

commit 8d65371
Author: Wouter Born <[email protected]>
Date:   Sun Dec 18 19:49:42 2022 +0100

    [shelly] Remove broken images (openhab#14007)

    See also openhab#13993

    Signed-off-by: Wouter Born <[email protected]>

commit 3613799
Author: Kai Takac <[email protected]>
Date:   Sun Dec 18 19:04:43 2022 +0100

    [jdbc] Update org.xerial/sqlite-jdbc to 3.40.0.0 (openhab#14003)

    * [jdbc] Update org.xerial/sqlite-jdbc to 3.40.0.0

    Co-authored-by: Jacob Laursen <[email protected]>
    Signed-off-by: Kai Takac <[email protected]>

commit ef836a1
Author: Дилян Палаузов <[email protected]>
Date:   Sun Dec 18 15:18:24 2022 +0200

    typos: success, successful (openhab#13997)

commit 6b1354f
Author: openhab-bot <[email protected]>
Date:   Sun Dec 18 14:02:15 2022 +0100

    New Crowdin updates (openhab#13999)

    * New translations iCloud.properties (French)

    * New translations openwebnet.properties (Italian)

    * New translations plugwise.properties (Dutch)

commit 6dd8cd5
Author: MikeTheTux <[email protected]>
Date:   Sun Dec 18 13:35:08 2022 +0100

    fixed potential StringIndexOutOfBoundsExceptions (openhab#14000)

    fixed compiler warnings

    Signed-off-by: Michael Weger <[email protected]>

commit debdfa5
Author: Holger Friedrich <[email protected]>
Date:   Sun Dec 18 11:55:59 2022 +0100

    [wolfsmartset] Fix link to external documentation (openhab#13996)

    Update link to current document from Wolf download center.
    Fixes openhab#13995.

    Signed-off-by: Holger Friedrich <[email protected]>

commit 9b89130
Author: Jacob Laursen <[email protected]>
Date:   Sun Dec 18 10:22:07 2022 +0100

    Fix alignment/indentation (openhab#13994)

    Fixes openhab#13882

    Signed-off-by: Jacob Laursen <[email protected]>

commit d03d3e4
Author: Wouter Born <[email protected]>
Date:   Sat Dec 17 23:53:57 2022 +0100

    Show add-on intros in Main UI (openhab#13992)

    Using these Markdown tweaks a small intro will show in Main UI instead of emptyness and a "more" button.

    Signed-off-by: Wouter Born <[email protected]>

commit 6753234
Author: Jacob Laursen <[email protected]>
Date:   Sat Dec 17 17:25:38 2022 +0100

    Fix Zigbee name stylization (openhab#13954)

    Signed-off-by: Jacob Laursen <[email protected]>

commit d20b103
Author: openhab-bot <[email protected]>
Date:   Sat Dec 17 16:51:35 2022 +0100

    New Crowdin updates (openhab#13990)

    * New translations tr064.properties (German)
    * New translations jsscripting.properties (Danish)
    * New translations jsscripting.properties (Italian)

commit 15e6beb
Author: Florian Hotze <[email protected]>
Date:   Sat Dec 17 15:42:23 2022 +0100

    [yamaha] README: Recommend correct binding for specific model (openhab#13985)

    This doc improvement tries to avoid future issue like openhab#10838.

    Signed-off-by: Florian Hotze <[email protected]>

commit 11e2c4f
Author: Florian Hotze <[email protected]>
Date:   Sat Dec 17 13:40:12 2022 +0100

    [jsscripting] Update add-on name in default translation (openhab#13984)

    Leftover from openhab#13764.

    Signed-off-by: Florian Hotze <[email protected]>

commit 4a13e1a
Author: openhab-bot <[email protected]>
Date:   Sat Dec 17 12:13:24 2022 +0100

    New Crowdin updates (openhab#13971)

    * New translations knx.properties (German)
    * New translations yamahamusiccast.properties (German)
    * New translations hdpowerview.properties (Danish)
    * New translations jsscripting.properties (Danish)

commit 23875a6
Author: Wouter Born <[email protected]>
Date:   Fri Dec 16 11:22:48 2022 +0100

    [mapdb] Fix "a" typo and use "-" for bullets in docs (openhab#13966)

    Signed-off-by: Wouter Born <[email protected]>

commit ab504bc
Author: Dan Cunningham <[email protected]>
Date:   Thu Dec 15 23:31:02 2022 -0800

    [hydrawise] fixes null pointer error for some sprinkler controllers (openhab#13965)

    Signed-off-by: Dan Cunningham <[email protected]>

commit 15ad22b
Author: Wouter Born <[email protected]>
Date:   Thu Dec 15 23:39:37 2022 +0100

    [mapdb] Add some documentation (openhab#13964)

    This is based on the original OH1 documentation.

    Signed-off-by: Wouter Born <[email protected]>

commit d6db727
Author: openhab-bot <[email protected]>
Date:   Thu Dec 15 23:36:49 2022 +0100

    New Crowdin updates (openhab#13962)

    * New translations chromecast.properties (Italian)
    * New translations sonos.properties (Italian)
    * New translations exec.properties (Italian)
    * New translations knx.properties (German)
    * New translations jsscripting.properties (German)
    * New translations yamahamusiccast.properties (German)

commit c75b04e
Author: Wouter Born <[email protected]>
Date:   Thu Dec 15 22:40:52 2022 +0100

    [wundergroundupdatereceiver] Prevent 😕 showing in documentation (openhab#13963)

    See: https://www.openhab.org/addons/bindings/wundergroundupdatereceiver/

    Signed-off-by: Wouter Born <[email protected]>

commit 9318f6f
Author: Holger Friedrich <[email protected]>
Date:   Thu Dec 15 16:22:43 2022 +0100

    [knx] Minor documentation update (openhab#13918)

    Slightly change wording of docs related to localSourceAddress to avoid
    address conflicts during initial setup.
    Add remark about knxd.
    Fixes openhab#13602.

    Signed-off-by: Holger Friedrich <[email protected]>

commit 83f0f7a
Author: Wouter Born <[email protected]>
Date:   Thu Dec 15 12:28:32 2022 +0100

    Prevent Markdown rendering issues in Main UI (openhab#13958)

    Some add-ons use `---` separators which causes issues when rendering the documentation in Main UI.

    Fixes openhab#13953

    Signed-off-by: Wouter Born <[email protected]>

commit 6ab0561
Author: Holger Friedrich <[email protected]>
Date:   Thu Dec 15 11:31:20 2022 +0100

    [rrd4j] Error handling for broken rrd4j files (openhab#13955)

    * [rrd4j] Error handling for broken rrd4j files

    Catch exceptions thrown by getDB(..) and print the name of the affected
    database file. This allows to identify a broken rrd4j file.

    Signed-off-by: Holger Friedrich <[email protected]>

commit 04f059c
Author: Simon Spielmann <[email protected]>
Date:   Thu Dec 15 09:18:11 2022 +0100

    [icloud] Rework authentication to reflect changes in iCloud API (openhab#13691)

    * Implement Authentication (WIP)
    * Validation Code accepted
    * Refactor session state
    * RefreshClient working
    * Implement session persistence in openhab store
    * Integration in binding
    * Remove persistent cookies, which break authentication
    * Bugfixing
    * Add code configuration to UI
    * Improve documentation, error-handling and cleanup
    * Rework auth order
    * Rework auth process
    * Add 2-FA-auth to documentation
    * Set bridge to online if data refresh works
    * Case-sensitive rename ICloudAPIResponseException
    * Include authentication in refresh flow
    * Fix regression for data not being updated
    * Fix typo in i18n props
    * Fix review and checkstyle.
    * More javadoc, new RetryException
    * Introduce @NonNullByDefault
    * Introduce server for RetryException, add NonNullbyDefault, fix warnings
    * Rework for contribution, e.g. null checks, ...
    * Fix checkstyle
    * Move JsonUtils to utilities package
    * Async initialize bridge handler.
    * Report Device OFFLINE if Bridge is OFFLINE
    * Set bridge thing status to UNKOWN in init
    * Move refresh init into async init
    * Cancel init task in dispose

    Also-by: Leo Siepel <[email protected]>
    Signed-off-by: Simon Spielmann <[email protected]>

commit 6e8b35c
Author: Wouter Born <[email protected]>
Date:   Thu Dec 15 07:51:22 2022 +0100

    [jsscripting] Fix broken event object table (openhab#13952)

    The table is not properly rendered when reading the documentation in Main UI.

    Signed-off-by: Wouter Born <[email protected]>

commit 79060f3
Author: Jørgen Austvik <[email protected]>
Date:   Wed Dec 14 20:15:47 2022 +0100

    [nanoleaf] Bugfix: Handle non-integer panel ids (openhab#13951)

    Panel ids are sometimes returned as BigInteger

    We haven't been able to understand why this happens somewhere and
    somewhere not, but this is an sledgehammer attempt to fix it quickly
    to unblock users, and then we will try to understand it later.

    Discussions:
    https://community.openhab.org/t/java-lang-classcastexception-class-java-math-bigdecimal-cannot-be-cast-to-class-java-lang-integer/142035/16
    https://community.openhab.org/t/nanoleaf-binding-oh3-stabilization-update/116300/61

    Signed-off-by: Jørgen Austvik <[email protected]>

commit d4ec220
Author: Florian Hotze <[email protected]>
Date:   Wed Dec 14 20:12:54 2022 +0100

    [jsscripting] Extend synchronization to common ScriptEngine methods (openhab#13924)

    * [jsscripting] Extend synchronization to common ScriptEngine methods

    This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the DelegatingScriptEngineWithInvocableAndAutocloseableAndSynchronization class. Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

    * Revert "[jsscripting] Extend synchronization to common ScriptEngine methods"

    This reverts commit aadd21e.

    * [jsscripting] Extend synchronization to common ScriptEngine methods & Switch to ReentrantLock

    This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable class.
    The synchronization mechanism changed from using synchronized to using a ReentrantLock together with catch_finally to avoid having deadlocks when an exception is thrown.
    Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

    * [jsscripting] Reduce compiler warnings
    * [jsscripting] Replace finally blocks & Wrap returns in afterInvocation
    * [jsscripting] Fix deadlock caused by NoSuchMethodException in Invocable interface methods

    During testing my latest changes, I noticed that there is a deadlock when invokeFunction or invokeMethod are called on a non-existing method.
    This happens because the NoSuchMethodException keeps afterInvocation from running and therefore the lock never gets released.

    * [jsscripting] Also rethrow NPE & Fix PMD warnings/errors
    * [jsscripting] Wrap and rethrow other exceptions instead of returning them
    * [jsscripting] Address review comment from @jpg0

    Signed-off-by: Florian Hotze <[email protected]>

commit 1ca9baf
Author: Jerome Luckenbach <[email protected]>
Date:   Wed Dec 14 16:52:43 2022 +0100

    [Documentation] Markdown improvements n to s (openhab#13948)

    Signed-off-by: Jerome Luckenbach <[email protected]>

commit d73218d
Author: Udo Hartmann <[email protected]>
Date:   Wed Dec 14 08:21:34 2022 +0100

    [mqtt.generic] Change color example (openhab#13861)

    Change color example to fit to the real parameters.

commit 4aca2c6
Author: Cody Cutrer <[email protected]>
Date:   Tue Dec 13 15:28:55 2022 -0700

    [jrubyscripting] remove some development logging that crept in (openhab#13947)

    Signed-off-by: Cody Cutrer <[email protected]>

commit 8314433
Author: lolodomo <[email protected]>
Date:   Tue Dec 13 09:04:16 2022 +0100

    [mielecloud] Fix integration tests (openhab#13935)

    Code change provided by @BjoernLange

    Signed-off-by: Laurent Garnier <[email protected]>

commit e9473ca
Author: Hilbrand Bouwkamp <[email protected]>
Date:   Tue Dec 13 08:40:10 2022 +0100

    [airq] fix table in readme that broke rendering markup (openhab#13937)

    Signed-off-by: Hilbrand Bouwkamp <[email protected]>

commit 9c3ec38
Author: openhab-bot <[email protected]>
Date:   Tue Dec 13 07:27:26 2022 +0100

    New Crowdin updates (openhab#13932)

    * New translations boschshc.properties (Italian)

    * New translations ecowatt.properties (French)

    * New translations nikohomecontrol.properties (Dutch)

    * New translations systeminfo.properties (Dutch)

    * New translations upnpcontrol.properties (Dutch)

commit bd087f1
Author: Jacob Laursen <[email protected]>
Date:   Mon Dec 12 22:55:38 2022 +0100

    Fix examples after migration of time channels (openhab#13933)

    Signed-off-by: Jacob Laursen <[email protected]>

commit 286a27d
Author: Wouter Born <[email protected]>
Date:   Mon Dec 12 22:12:24 2022 +0100

    [nest] Add missing enable SDM API configuration step to README.md (openhab#13931)

    Fixes openhab#11814

    Signed-off-by: Wouter Born <[email protected]>

commit 518272a
Author: Jacob Laursen <[email protected]>
Date:   Mon Dec 12 22:10:48 2022 +0100

    Fix dimension for powerConsumption channel (openhab#13930)

    Fixes openhab#13929

    Signed-off-by: Jacob Laursen <[email protected]>

commit e027932
Author: lolodomo <[email protected]>
Date:   Mon Dec 12 20:28:59 2022 +0100

    [goecharger] Consider correct channel ID (maxCurrentTemp) (openhab#13927)

    Fix openhab#13891

    Signed-off-by: Laurent Garnier <[email protected]>
borazslo pushed a commit to borazslo/openhab-mideaac-addon that referenced this pull request Jan 8, 2023
…penhab#13924)

* [jsscripting] Extend synchronization to common ScriptEngine methods

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the DelegatingScriptEngineWithInvocableAndAutocloseableAndSynchronization class. Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

* Revert "[jsscripting] Extend synchronization to common ScriptEngine methods"

This reverts commit aadd21e.

* [jsscripting] Extend synchronization to common ScriptEngine methods & Switch to ReentrantLock

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable class.
The synchronization mechanism changed from using synchronized to using a ReentrantLock together with catch_finally to avoid having deadlocks when an exception is thrown.
Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

* [jsscripting] Reduce compiler warnings
* [jsscripting] Replace finally blocks & Wrap returns in afterInvocation
* [jsscripting] Fix deadlock caused by NoSuchMethodException in Invocable interface methods

During testing my latest changes, I noticed that there is a deadlock when invokeFunction or invokeMethod are called on a non-existing method.
This happens because the NoSuchMethodException keeps afterInvocation from running and therefore the lock never gets released.

* [jsscripting] Also rethrow NPE & Fix PMD warnings/errors
* [jsscripting] Wrap and rethrow other exceptions instead of returning them
* [jsscripting] Address review comment from @jpg0

Signed-off-by: Florian Hotze <[email protected]>
psmedley pushed a commit to psmedley/openhab-addons that referenced this pull request Feb 23, 2023
…penhab#13924)

* [jsscripting] Extend synchronization to common ScriptEngine methods

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the DelegatingScriptEngineWithInvocableAndAutocloseableAndSynchronization class. Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

* Revert "[jsscripting] Extend synchronization to common ScriptEngine methods"

This reverts commit aadd21e.

* [jsscripting] Extend synchronization to common ScriptEngine methods & Switch to ReentrantLock

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable class.
The synchronization mechanism changed from using synchronized to using a ReentrantLock together with catch_finally to avoid having deadlocks when an exception is thrown.
Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

* [jsscripting] Reduce compiler warnings
* [jsscripting] Replace finally blocks & Wrap returns in afterInvocation
* [jsscripting] Fix deadlock caused by NoSuchMethodException in Invocable interface methods

During testing my latest changes, I noticed that there is a deadlock when invokeFunction or invokeMethod are called on a non-existing method.
This happens because the NoSuchMethodException keeps afterInvocation from running and therefore the lock never gets released.

* [jsscripting] Also rethrow NPE & Fix PMD warnings/errors
* [jsscripting] Wrap and rethrow other exceptions instead of returning them
* [jsscripting] Address review comment from @jpg0

Signed-off-by: Florian Hotze <[email protected]>
nemerdaud pushed a commit to nemerdaud/openhab-addons that referenced this pull request Feb 28, 2023
…penhab#13924)

* [jsscripting] Extend synchronization to common ScriptEngine methods

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the DelegatingScriptEngineWithInvocableAndAutocloseableAndSynchronization class. Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

* Revert "[jsscripting] Extend synchronization to common ScriptEngine methods"

This reverts commit aadd21e.

* [jsscripting] Extend synchronization to common ScriptEngine methods & Switch to ReentrantLock

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable class.
The synchronization mechanism changed from using synchronized to using a ReentrantLock together with catch_finally to avoid having deadlocks when an exception is thrown.
Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

* [jsscripting] Reduce compiler warnings
* [jsscripting] Replace finally blocks & Wrap returns in afterInvocation
* [jsscripting] Fix deadlock caused by NoSuchMethodException in Invocable interface methods

During testing my latest changes, I noticed that there is a deadlock when invokeFunction or invokeMethod are called on a non-existing method.
This happens because the NoSuchMethodException keeps afterInvocation from running and therefore the lock never gets released.

* [jsscripting] Also rethrow NPE & Fix PMD warnings/errors
* [jsscripting] Wrap and rethrow other exceptions instead of returning them
* [jsscripting] Address review comment from @jpg0

Signed-off-by: Florian Hotze <[email protected]>
andrasU pushed a commit to andrasU/openhab-addons that referenced this pull request Jan 6, 2024
…penhab#13924)

* [jsscripting] Extend synchronization to common ScriptEngine methods

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the DelegatingScriptEngineWithInvocableAndAutocloseableAndSynchronization class. Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

* Revert "[jsscripting] Extend synchronization to common ScriptEngine methods"

This reverts commit aadd21e.

* [jsscripting] Extend synchronization to common ScriptEngine methods & Switch to ReentrantLock

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable class.
The synchronization mechanism changed from using synchronized to using a ReentrantLock together with catch_finally to avoid having deadlocks when an exception is thrown.
Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

* [jsscripting] Reduce compiler warnings
* [jsscripting] Replace finally blocks & Wrap returns in afterInvocation
* [jsscripting] Fix deadlock caused by NoSuchMethodException in Invocable interface methods

During testing my latest changes, I noticed that there is a deadlock when invokeFunction or invokeMethod are called on a non-existing method.
This happens because the NoSuchMethodException keeps afterInvocation from running and therefore the lock never gets released.

* [jsscripting] Also rethrow NPE & Fix PMD warnings/errors
* [jsscripting] Wrap and rethrow other exceptions instead of returning them
* [jsscripting] Address review comment from @jpg0

Signed-off-by: Florian Hotze <[email protected]>
Signed-off-by: Andras Uhrin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants