这段代码抛出错误 此方法使用从 keySet 迭代器检索到的键访问 Map 条目的值。在地图的 entrySet 上使用迭代器更有效,以避免 Map.get(key) 查找。请指导我如何改写它
if (docPropertiesMap != null) {
Iterator<String> properties = docPropertiesMap.keySet().iterator();
IDocProperty[] docProperties = new IDocProperty[docPropertiesMap
.size()];
int iArrIndex = 0;
while (properties.hasNext()) {
String strPropName = properties.next();
String[] propValue = docPropertiesMap.get(strPropName);
IDocProperty docProperty = (IDocProperty) FDMAFactory
.getDataObject("DocProperty");
docProperty.setPropertyName(strPropName);
docProperty.setArrPropertyValues(propValue);
docProperties[iArrIndex++] = docProperty;
}
metadata.setArrDocProperties(docProperties);
return metadata;
}