From 934a8f575988e66569594e3db3bae0ec6529c8e8 Mon Sep 17 00:00:00 2001 From: Alexander Slesarenko Date: Tue, 23 Aug 2022 14:33:01 +0200 Subject: [PATCH] i825-robovm: avoid usage of Java 8 getOrDefault method --- .../src/main/scala/special/collection/Helpers.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library-impl/src/main/scala/special/collection/Helpers.scala b/library-impl/src/main/scala/special/collection/Helpers.scala index 9f131b3f54..e4a4d93ea5 100644 --- a/library-impl/src/main/scala/special/collection/Helpers.scala +++ b/library-impl/src/main/scala/special/collection/Helpers.scala @@ -27,7 +27,11 @@ object Helpers { var nValues = 0 while (i < arr.length) { val (key, value) = m(arr(i)) - val pos = keyPositions.getOrDefault(key, 0) + val pos = { + val p: Integer = keyPositions.get(key) + if (p == null) 0 else p.intValue() + } + if (pos == 0) { keyPositions.put(key, nValues + 1) keys += key