Open ViToni opened 1 year ago
TODO:
com.zsmartsystems.zigbee.console.main.ZigBeeConsole.TransactionQueuesCommand.process(ZigBeeApi, String[], PrintStream)
is using an empty Runnable
to start a Thread
. Wondering if this is just a CnP error or if it has more to it.@cdjackson Would you mind taking a look at this one?
@ViToni my concern here is that on some Android versions I understand that lambda expressions are not available, so we have for that reason avoided them. Now that concern is possibly no longer an issue - I'm not sure, but I'm just a bit wary to make this change and find it breaks compatibility.
@cdjackson Thanks for the feedback. Didn't know about restrictions regarding Android / Lambda expressions (but I have to admit I'm not deep into Android regarding development). But indeed I remember that some early versions of Java 8 had some issues regarding Lambda expressions but AFAIK these have been fixed for some time now.
Regarding the first Android version supporting Java 8, from what I found, it seems to be Android Nougat from August 2016 or respective Android Studio 3.0.0 from October 2017. The final release of Nougat was October 2019. The Java 8 support page mentions only serialization of Lambdas not being supported, not sure if serialization has been used anywhere in project on Runnables.
Don't know if this information helps on the decision though...
I found that animal sniffer throws an error with your recent addition of a lambda in the queue management PR, so i guess that answers the compatibility question ;)
By switching to Java8 (#408)
Runnable
wrappers can be replaced be Lambda expression or even method references as done in this PR.