mirror of
https://github.com/danieldemus/openhab-core.git
synced 2026-07-29 12:34:22 +02:00
Java 21 language features (#4535)
* Java 21 language features * use getFirst and getLast methods * replace new Locale by Locale.of * replace Paths.get by Path.of * use ThreadLocalRandom.current().nextDouble() * add @Serial annotations Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
+1
-1
@@ -72,7 +72,7 @@ public class Translations {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return entries.get(0).getKey().compareTo(other.entries.get(0).getKey());
|
||||
return entries.getFirst().getKey().compareTo(other.entries.getFirst().getKey());
|
||||
}
|
||||
|
||||
public boolean hasTranslations() {
|
||||
|
||||
+2
-4
@@ -191,8 +191,7 @@ public class XmlToTranslationsConverter {
|
||||
.map(ThingType::getConfigDescriptionURI) //
|
||||
.distinct() //
|
||||
.map(bundleInfo::getConfigDescription) //
|
||||
.filter(Optional::isPresent) //
|
||||
.map(Optional::get));
|
||||
.flatMap(Optional::stream));
|
||||
|
||||
Builder<TranslationsGroup> groupsBuilder = Stream.builder();
|
||||
|
||||
@@ -314,8 +313,7 @@ public class XmlToTranslationsConverter {
|
||||
.map(ChannelType::getConfigDescriptionURI) //
|
||||
.distinct() //
|
||||
.map(bundleInfo::getConfigDescription) //
|
||||
.filter(Optional::isPresent) //
|
||||
.map(Optional::get));
|
||||
.flatMap(Optional::stream));
|
||||
|
||||
Builder<TranslationsGroup> groupsBuilder = Stream.builder();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user