mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[insteon] Prevent null values from being inferred when printing to console (#12243)
This prevents the null analysis from inferring null values when printing to a Console. Related to openhab/openhab-core#2742 Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
parent
43cef812ae
commit
14058c1603
@ -12,10 +12,9 @@
|
||||
*/
|
||||
package org.openhab.binding.insteon.internal.handler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@ -244,10 +243,9 @@ public class InsteonNetworkHandler extends BaseBridgeHandler {
|
||||
}
|
||||
|
||||
private void display(Console console, Map<String, String> info) {
|
||||
ArrayList<String> ids = new ArrayList<>(info.keySet());
|
||||
Collections.sort(ids);
|
||||
for (String id : ids) {
|
||||
console.println(info.get(id));
|
||||
}
|
||||
info.entrySet().stream() //
|
||||
.sorted(Entry.comparingByKey()) //
|
||||
.map(Entry::getValue) //
|
||||
.forEach(console::println);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user