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

[homematic] Remove dependency org.apache.commons.* from AbstractHomematicGateway #10027

Closed
wants to merge 1 commit into from

Conversation

pavog
Copy link
Contributor

@pavog pavog commented Feb 2, 2021

This removes the dependency org.apache.commons.lang.StringUtils from AbstractHomematicGateway

Since id is set in the constructor, it is not null and calling StringUtils.upperCase(id) does the same as id.toUpperCase() and is not needed here.

Related to #7722

@pavog pavog requested a review from gerrieg as a code owner February 2, 2021 08:57
…mematicGateway

Since id is set in the constructor, it is not null and calling StringUtils.upperCase(id) does the same as id.toUpperCase()

Signed-off-by: Paul Vogel <[email protected]>
Copy link
Contributor

@Skinah Skinah left a comment

Choose a reason for hiding this comment

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

LGTM

@MHerbst
Copy link
Contributor

MHerbst commented Feb 2, 2021

@pavog don't know how far along you are with removing org.apache.commons, but I expect to post a PR tonight or tomorrow removing org.apache.commons from all classes. I just want to inform you so that you do not make too much work for yourself, because I have finished the work and the changes will need some tests and review.

@@ -800,7 +799,7 @@ public HomematicGatewayAdapter getGatewayAdapter() {
* Creates a virtual device for handling variables, scripts and other special gateway functions.
*/
private HmDevice createGatewayDevice() {
String type = String.format("%s-%s", HmDevice.TYPE_GATEWAY_EXTRAS, StringUtils.upperCase(id));
String type = String.format("%s-%s", HmDevice.TYPE_GATEWAY_EXTRAS, id.toUpperCase());
Copy link
Contributor

@cpmeister cpmeister Feb 4, 2021

Choose a reason for hiding this comment

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

Is there any chance that the id is null? The class doesn't have a @NonNullByDefault so the null checker isn't guaranteeing that it isn't null.

@pavog
Copy link
Contributor Author

pavog commented Feb 4, 2021

@MHerbst opened pr #10035 which removes all usages of apache commons functions in the homematic binding. So this pr is no longer needed. Thank you guys!

@pavog pavog closed this Feb 4, 2021
@pavog pavog deleted the patch-2 branch February 4, 2021 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants