Class valClass = aNVP.getValue().getClass();
if (aParam.isMultiValued()) // value must be an array
{
if (!valClass.isArray()) {
throw new ResourceConfigurationException(ResourceConfigurationException.ARRAY_REQUIRED,
new Object[] { paramName, getName() });
}
valClass = valClass.getComponentType();
// check for zero-length array special case
if (Array.getLength(aNVP.getValue()) == 0 && valClass.equals(Object.class)) {
aNVP.setValue(Array.newInstance(getClassForParameterType(paramType), 0));
return;
}
}
if (valClass != getClassForParameterType(paramType)) {
throw new ResourceConfigurationException(
ResourceConfigurationException.PARAMETER_TYPE_MISMATCH, new Object[] { getName(),
valClass.getName(), paramName, paramType });
}
}