From c4f3025c8053c0ca1db6af524be0d9e3b335d25b Mon Sep 17 00:00:00 2001 From: Peter Hormanns Date: Fri, 29 Dec 2017 19:13:24 +0100 Subject: [PATCH] nashorn maps js-array to java-map --- .../mapping/DefaultStringSetParameterMapMapper.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/framework/src/main/java/de/hsadmin/module/property/mapping/DefaultStringSetParameterMapMapper.java b/framework/src/main/java/de/hsadmin/module/property/mapping/DefaultStringSetParameterMapMapper.java index fb6c1b6..ce5c267 100644 --- a/framework/src/main/java/de/hsadmin/module/property/mapping/DefaultStringSetParameterMapMapper.java +++ b/framework/src/main/java/de/hsadmin/module/property/mapping/DefaultStringSetParameterMapMapper.java @@ -2,6 +2,7 @@ package de.hsadmin.module.property.mapping; import java.util.Arrays; import java.util.Map; +import java.util.Set; import de.hsadmin.common.error.TechnicalException; import de.hsadmin.common.error.UserException; @@ -35,6 +36,16 @@ public class DefaultStringSetParameterMapMapper implements idx++; } } + if (rpcParam instanceof Map) { + final Map rpcParamMap = (Map) rpcParam; + final Set keySet = rpcParamMap.keySet(); + strings = new String[rpcParamMap.size()]; + for (int idx = 0; idx < strings.length; idx++) { + final Object object = keySet.toArray()[idx]; + final String val = (String) rpcParamMap.get(object); + strings[idx] = val; + } + } value.setStrings(strings); return value; }