if (jd.getParametersMap().get(key) != null){
log.warn("Parameter \"" + key + "\" already registered, skipping this one.");
continue;
}
JRDesignParameter parameter = new JRDesignParameter();
Object value = _parameters.get(key);
if (value == null) //There are some Map implementations that allows nulls values, just go on
continue;
// parameter.setValueClassName(value.getClass().getCanonicalName());
Class clazz = value.getClass().getComponentType();
if (clazz == null)
clazz = value.getClass();
parameter.setValueClass(clazz); //NOTE this is very strange
//when using an array as subreport-data-source, I must pass the parameter class name like this: value.getClass().getComponentType()
parameter.setName((String)key);
jd.addParameter(parameter);
} catch (JRException e) {
//nothing to do
}
}