From da4c982d256f3cccd609378e8974da70831c708b Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Wed, 22 Jul 2015 07:13:40 +0200 Subject: fix bug in methode findNextFreeListCounter if actually no list exists --- .../java/at/gv/egovernment/moa/id/commons/utils/KeyValueUtils.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'id/server/moa-id-commons/src/main/java/at/gv') diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/KeyValueUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/KeyValueUtils.java index 04eb30f72..8f3a8402d 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/KeyValueUtils.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/KeyValueUtils.java @@ -224,7 +224,12 @@ public class KeyValueUtils { */ public static int findNextFreeListCounter(Set keySet, String listPrefix) { - return findNextFreeListCounter((String[]) keySet.toArray(), listPrefix); + if (keySet.isEmpty()) + return 0; + + String[] array = new String[keySet.size()]; + keySet.toArray(array); + return findNextFreeListCounter(array, listPrefix); } -- cgit v1.2.3