-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Removal of dependency on 'org.apache.commons.*' #7722
Comments
Relative to openhab#7722 Signed-off-by: Laurent Garnier <[email protected]>
Relative to openhab#7722 Signed-off-by: Laurent Garnier <[email protected]>
Relative to openhab#7722 Signed-off-by: Laurent Garnier <[email protected]>
Relative to openhab#7722 Signed-off-by: Laurent Garnier <[email protected]>
Relative to openhab#7722 Signed-off-by: Laurent Garnier <[email protected]>
Relative to openhab#7722 Signed-off-by: Laurent Garnier <[email protected]>
Relative to openhab#7722 Signed-off-by: Laurent Garnier <[email protected]>
Relative to openhab#7722 Signed-off-by: Laurent Garnier <[email protected]>
Relative to openhab#7722 Signed-off-by: Laurent Garnier <[email protected]
Relative to openhab#7722 Signed-off-by: Laurent Garnier <[email protected]>
Relative to openhab#7722 Signed-off-by: Laurent Garnier <[email protected]>
Relative to openhab#7722 Signed-off-by: Laurent Garnier <[email protected]>
Relative to openhab#7722 Signed-off-by: Laurent Garnier <[email protected]>
@openhab/add-ons-maintainers As I'm almost half way, i like to get some reviews, merges or feedback before i proceed. It takes less time than i thought, so might do the others too. edit: Sorry for all the PR's, but once i got started i could not help it and continued. edit2: Finished for now. If the subnetutils fix is ok, I’ll apply them to the remaining ones. So maybe it is a good moment to look after the others. I hope we can now 'blacklist' all the org.apache libs and only whitelist the ones below. @wborn mentioned .net earlier, but i would like to propose to add the others too, as they are more than just a simple convenience helper. If you look at the unscapehtml4 method for instance, it is complex, large and perfectly maintained outside of openHAB. Bringing that into openHAB would be introducing unnecessary maintenance if you ask me. Maybe add a proxy utility class in core, addons can access those util classes and it re-routes to the apache libs. In that way it is easy to prevent these lib usage in addons and if anyone is ever feeling to imnplement them it can be done without any change in addons repo.
|
@hypetsch i could also fix the unescapeHtml4 for the bsblan binding, because it only unescapes units. I don't have such a device and the openapi documentation lacks details about possible units. Could you be of any help telling me the possible units? Is it only celcius and fahrenheit or are there more units? |
I don't have a device with the latest firmware either, but from a quick look in the repo it seems to me that - at least in the latest version - the units depend on the localization and should for e.g. German be the "defines" starting with UNIT_ specified in https://github.com/fredlcore/BSB-LAN/blob/master/BSB_LAN/localization/LANG_DE.h |
Signed-off-by: Gerd Zanker <[email protected]>
Only a few left: $ grep -R "org.apache.commons.lang3.StringUtils"
bundles/org.openhab.binding.sensibo/src/main/java/org/openhab/binding/sensibo/internal/model/SensiboModel.java:import org.apache.commons.lang3.StringUtils;
bundles/org.openhab.binding.sensibo/src/main/java/org/openhab/binding/sensibo/internal/model/SensiboSky.java:import org.apache.commons.lang3.StringUtils;
bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/TokenSearch.java:import org.apache.commons.lang3.StringUtils;
bundles/org.openhab.binding.fineoffsetweatherstation/src/main/java/org/openhab/binding/fineoffsetweatherstation/internal/domain/DebugDetails.java:import org.apache.commons.lang3.StringUtils;
$ grep -R "org.apache.commons.lang3"
bundles/org.openhab.binding.sensibo/src/main/java/org/openhab/binding/sensibo/internal/model/SensiboModel.java:import org.apache.commons.lang3.StringUtils;
bundles/org.openhab.binding.sensibo/src/main/java/org/openhab/binding/sensibo/internal/model/SensiboSky.java:import org.apache.commons.lang3.StringUtils;
bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/TokenSearch.java:import org.apache.commons.lang3.StringUtils;
bundles/org.openhab.persistence.mongodb/src/test/java/org/openhab/persistence/mongodb/internal/VerificationHelper.java:import org.apache.commons.lang3.tuple.Pair;
bundles/org.openhab.binding.fineoffsetweatherstation/src/main/java/org/openhab/binding/fineoffsetweatherstation/internal/domain/DebugDetails.java:import org.apache.commons.lang3.StringUtils;
itests/org.openhab.binding.max.tests/itest.bndrun: org.apache.commons.lang3;version='[3.14.0,3.14.1)',\ |
Any suggestions on how to fix this for the mongodb? It depends on this |
How about something like: public record Pair<L, R>(L left, R right) {} ? The refactoring risk should be low as it is only used in a test class. |
Thanks for the sugggestion. Just created a PR to get this done. |
@lsiepel - I believe this issue can finally be closed? 😄 $ grep -R "org.apache.commons.lang3"
bundles/org.openhab.binding.argoclima/src/main/java/org/openhab/binding/argoclima/internal/utils/StringUtils.java: * @implNote The interface is modeled on {@link org.apache.commons.lang3.StringUtils} interface (which is not used as it
bundles/org.openhab.binding.argoclima/src/main/java/org/openhab/binding/argoclima/internal/utils/StringUtils.java: * @implNote API-compatible with {@link org.apache.commons.lang3.StringUtils#strip(String, String)} (except for
bundles/org.openhab.binding.argoclima/src/main/java/org/openhab/binding/argoclima/internal/utils/StringUtils.java: * @implNote API-compatible with {@link org.apache.commons.lang3.StringUtils#splitByWholeSeparator(String, String)} |
@lsiepel - sorry, it cannot: grep -R "org.apache.commons." |
We are not there yet. Let’s hope 4.2 is the last one with these libs 😁 |
Think this can be closed now? There are some apache dependency's left, but they are sub of |
In openhab/openhab-core#1433 and openhab/openhab-core#1441 (and more) we removed dependency on
org.apache.commons.*
libraries. They will be removed from OH3 Core API and thus not available anymore for OH add-ons too. Most of the methods which are used by several bindings are convenience helper methods and can be replaced easily by basic Java methods. Other methods are not yet available in Java 8 but in Java 11 and have to be replace later. It would be a good start to remove as much as we can before.org.apache.commons.net
is an exception be because is is used byorg.openhab.core.serial
and thus it will be okay for add-ons too.The text was updated successfully, but these errors were encountered: