有如下代码:
protected void itemControlForDocumentUpload(SmartCabinet cabinet, Map<String, List<?>> itemControlMap,
DataRecordImpl dataRecord) throws Exception {
if (dataRecord != null) {
for (Integer itemId : dataRecord.getItemIdList()) {
//这个里面做了一下清空value的操作,然后就出了错误。
((AbstractFormItemData) dataRecord.getData(itemId)).itemControlUploadCheck(itemControlMap,
dataRecord, cabinet);
}
}
}
itemControlUploadCheck()方法如下:
public void itemControlUploadCheck(Map<String, List<?>> itemControlMap, DataRecordImpl dataRecord,
SmartCabinet cabinet)
throws Exception {
setItemControlFlag(cabinet, itemControlMap);
if (this.isInHiddenBlock()) {
//这里是清空value的方法
clearItemsValue(cabinet, itemControlMap, dataRecord);
清空value的方法如下:
public void clearItemsValue(SmartCabinet cabinet, Map<String, List<?>> itemControlMap,
DataRecordImpl dataRecord) throws Exception {
if (((AbstractFormItem) cabinet.getForm().findItem(this.itemId)).getBlock() != null) {
int blockId = ((AbstractFormItem) cabinet.getForm().findItem(this.itemId)).getBlock().getId();
List<Integer> hideBlockIdList = (List<Integer>) itemControlMap.get("hide");
if (hideBlockIdList != null && hideBlockIdList.size() > 0) {
for (int i = 0; i < hideBlockIdList.size(); i++) {
if (hideBlockIdList.get(i).equals(blockId)) {
FormBlock block = cabinet.getForm().getBlockList().getBlock(blockId);
for (FormItem item : block.getFormItems()) {
AbstractFormItemData data = ((AbstractFormItemData) dataRecord
.getData(item.getId()));
if (data != null) {
//这里是清空value
data.clear();
}
}
}
}
}
}
}
清空完vlaue之后,返回到第一个函数注释那块,就报错误了,错误如下:
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextNode(HashMap.java:1437)
at java.util.HashMap$KeyIterator.next(HashMap.java:1461)
at jp.co.dreamarts.insuite.brd.action.DocumentAction.itemControlForDocumentUpload(DocumentAction.java:4561)
at jp.co.dreamarts.insuite.brd.action.DocumentAction.doUpdate(DocumentAction.java:1389)
at jp.co.dreamarts.hibiki.smartdb.struts.DispatchingDocumentAction.doUpdate(DispatchingDocumentAction.java:47)
at jp.co.dreamarts.insuite.brd.action.DocumentAction.doUpdate(DocumentAction.java:1305)
这个要怎么解决啊。。。
添加回答
举报
0/150
提交
取消