From 3db78c680ba7d5a67c690e55c5e4f1a00873d447 Mon Sep 17 00:00:00 2001 From: Robin Leroy Date: Wed, 4 Oct 2023 00:10:33 +0200 Subject: [PATCH] Modern Java --- .../main/java/org/unicode/text/UCD/MakeUnicodeFiles.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/unicodetools/src/main/java/org/unicode/text/UCD/MakeUnicodeFiles.java b/unicodetools/src/main/java/org/unicode/text/UCD/MakeUnicodeFiles.java index de6a5dea9..2cc946821 100644 --- a/unicodetools/src/main/java/org/unicode/text/UCD/MakeUnicodeFiles.java +++ b/unicodetools/src/main/java/org/unicode/text/UCD/MakeUnicodeFiles.java @@ -366,11 +366,9 @@ private void build() { value = ""; } else if (line.startsWith("Value:")) { value = lineValue; - var values = propertyToOrderedValues.get(property); - if (values == null) { - values = new ArrayList(); - propertyToOrderedValues.put(property, values); - } + final var values = + propertyToOrderedValues.computeIfAbsent( + property, k -> new ArrayList()); values.add(value); } else if (line.startsWith("HackName:")) { final String regularItem = Utility.getUnskeleton(lineValue, true);