-
-
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
[homematic] Replaced deprecated constructors #7352
Conversation
Signed-off-by: Martin Herbst <develop@mherbst.de>
Travis tests were successfulHey @MHerbst, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the quick work. On request - see comment:
@@ -301,11 +303,10 @@ public EventOption createOption(String value, String description) { | |||
return new EventOption(value, description); | |||
} | |||
})); | |||
|
|||
} | |||
channelType = new ChannelType(channelTypeUID, !MetadataUtils.isStandard(dp), itemType, channelKind, label, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While you are already touching the code, may I ask you to replace this constructor by ChannelTypeBuilder too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have expected this comment :-). Unfortunately I could not simply replace it by the ChannelTypeBuilder because the parameter channelKind
is an enum here. The constructor call is used to create State channels as well as Trigger channels. This means some additional changes are necessary and I preferred to do this in a separate step to get rid of these deprecated constructors as soon as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get your point and of course it is an improvement but the thing is that exactly this ctor will be removed in openhab/openhab-core#1414 and thus this PR will not fix the build of the OH3 add-on port.
Isn't this code snippet a simple solution:
}));
channelType = ChannelTypeBuilder.trigger(channelTypeUID, label).with....build();
}
channelType = ChannelTypeBuilder.state(channelTypeUID, label, itemType).with....build();
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, this constructor is currently not marked as deprecated. Therefore I thought I could use it.
I have changed it.
Signed-off-by: Martin Herbst <develop@mherbst.de>
Travis tests were successfulHey @MHerbst, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks.
Working nicely now.
…b#7352) * Replaced deprecated constructors * Use of builder instead of constructor Signed-off-by: Martin Herbst <develop@mherbst.de> Signed-off-by: Eugen Freiter <freiter@gmx.de>
…b#7352) * Replaced deprecated constructors * Use of builder instead of constructor Signed-off-by: Martin Herbst <develop@mherbst.de>
…b#7352) * Replaced deprecated constructors * Use of builder instead of constructor Signed-off-by: Martin Herbst <develop@mherbst.de>
…b#7352) * Replaced deprecated constructors * Use of builder instead of constructor Signed-off-by: Martin Herbst <develop@mherbst.de>
…b#7352) * Replaced deprecated constructors * Use of builder instead of constructor Signed-off-by: Martin Herbst <develop@mherbst.de> Signed-off-by: CSchlipp <christian@schlipp.de>
…b#7352) * Replaced deprecated constructors * Use of builder instead of constructor Signed-off-by: Martin Herbst <develop@mherbst.de>
…b#7352) * Replaced deprecated constructors * Use of builder instead of constructor Signed-off-by: Martin Herbst <develop@mherbst.de>
…b#7352) * Replaced deprecated constructors * Use of builder instead of constructor Signed-off-by: Martin Herbst <develop@mherbst.de>
…b#7352) * Replaced deprecated constructors * Use of builder instead of constructor Signed-off-by: Martin Herbst <develop@mherbst.de>
…b#7352) * Replaced deprecated constructors * Use of builder instead of constructor Signed-off-by: Martin Herbst <develop@mherbst.de> Signed-off-by: Daan Meijer <daan@studioseptember.nl>
…b#7352) * Replaced deprecated constructors * Use of builder instead of constructor Signed-off-by: Martin Herbst <develop@mherbst.de>
The binding used some deprecated constructors. These usages have been replaced to allow the removal of these constructors. See also: openhab/openhab-core#1414