@@ -174,32 +174,16 @@ private List<ConfigDescriptionParameter> getConfigDescriptionParameters(Channel
174
174
* Get non default channels.
175
175
* It includes extensible channels and channels with a non default configuration.
176
176
*
177
- * Resulting channels are sorted in such a way that channels without channel type are after channels
178
- * with a channel type. Sort is done first on the channel type and then on the channel UID.
179
- *
180
177
* @param thing the thing
181
- * @return the sorted list of channels
178
+ * @return the list of channels
182
179
*/
183
180
protected List <Channel > getNonDefaultChannels (Thing thing ) {
184
181
ThingType thingType = thingTypeRegistry .getThingType (thing .getThingTypeUID ());
185
182
List <String > ids = thingType != null ? thingType .getExtensibleChannelTypeIds () : List .of ();
186
- List < Channel > channels = thing
183
+ return thing
187
184
.getChannels ().stream ().filter (ch -> ch .getChannelTypeUID () == null
188
185
|| ids .contains (ch .getChannelTypeUID ().getId ()) || channelWithNonDefaultConfig (ch ))
189
186
.collect (Collectors .toList ());
190
- return channels .stream ().sorted ((ch1 , ch2 ) -> {
191
- ChannelTypeUID typeUID1 = ch1 .getChannelTypeUID ();
192
- ChannelTypeUID typeUID2 = ch2 .getChannelTypeUID ();
193
- if (typeUID1 != null && typeUID2 == null ) {
194
- return -1 ;
195
- } else if (typeUID1 == null && typeUID2 != null ) {
196
- return 1 ;
197
- } else if (typeUID1 != null && typeUID2 != null && !typeUID1 .equals (typeUID2 )) {
198
- return typeUID1 .getAsString ().compareTo (typeUID2 .getAsString ());
199
- } else {
200
- return ch1 .getUID ().getAsString ().compareTo (ch2 .getUID ().getAsString ());
201
- }
202
- }).collect (Collectors .toList ());
203
187
}
204
188
205
189
private boolean channelWithNonDefaultConfig (Channel channel ) {
0 commit comments