将数组插入 Map 时出现 UnsupportedOperationException。地图的输入是正确的。有什么合适的方法可以正确插入并返回数据吗?
public static Map<String, ProductClassPeriodData[]> getPeriodsByAgreement(String[] productClassIds,String agreementId)
{
Map data = Collections.EMPTY_MAP;
for (int i = 0; i < productClassIds.length; i++)
{
ProductClassPeriodData[] periodData = getInstance().getProductClassPeriodsByAgreement(productClassIds[i], agreementId);
data.put(String.valueOf(i), periodData);
}
return data;
}