zoukankan      html  css  js  c++  java
  • 偶遇到 java.util.ConcurrentModificationException 的异常

    今天在调试程序 遇到了如此问题  贴上代码来看看
    稍后分析

    List<String> list = null;
    boolean isUpdate = false;
    try {
    list = JSON.parse(var.getValue(), ArrayList.class);
    if(CollectionUtils.isNotEmpty(list)){
    for (String workno : list) {
    if (cmd.getUserId().toString().equals(workno)) {
    isUpdate = true;
    list.remove(workno);
    //排除重复
    if (!list.contains(cmd.getTransferUserId().toString())) {
    list.add(cmd.getTransferUserId().toString());
    }
    }
    }
    map.put(var.getName(), JSON.json(list));
    }
    } catch (ParseException e) {
    log.warn("Admin|doTransPermissions|Exception", e);
    throw new UedException(e);
    } catch (IOException e) {
    log.warn("Admin|doTransPermissions|Exception", e);
    throw new UedException(e);
    }java.util.ConcurrentModificationException原因
  • 相关阅读:
    笔记
    Dwarf Tower
    第k小数
    np
    noi 抓住那头牛
    HDU 1575 Try A
    acm 易错警示
    E
    魔改森林 题解(dp+容斥+组合数学)
    F. Unusual Matrix 题解(思维)
  • 原文地址:https://www.cnblogs.com/vinplezhang/p/6221923.html
Copyright © 2011-2022 走看看