??????????????java??????У?????????????????????????????????в???????????????????????????????????????“Java????????????????е??????”??????

???????????д??????????

????private void screenBlackNameList(List<SharedBoardSmsWrapper> source?? List<BlackNameListModel> blackNameList)

??????????????????source?????б??????Щ??????????????blackNameList?????б????????????б???????????????????????source?????к????????????????????

??????????????????????????

?????????????for each ???????????

    for(SharedBoardSmsWrapper tmpSharedBoardSmsWrapper:source){ 
             
            for(BlackNameListModel tmpBlackNameListModel:blackNameList){ 
                if(tmpSharedBoardSmsWrapper.getSource().equals(tmpBlackNameListModel.getSource())){ 
                   source.remove(tmpSharedBoardSmsWrapper); 
                   break; 
                } 
                 
            } 
        }

for(SharedBoardSmsWrapper tmpSharedBoardSmsWrapper:source){                  for(BlackNameListModel tmpBlackNameListModel:blackNameList){             if(tmpSharedBoardSmsWrapper.getSource().equals(tmpBlackNameListModel.getSource())){                source.remove(tmpSharedBoardSmsWrapper);                break;             }                      }     }

??????????????????Ц??

????????…

??????????????????δ????????????

????java.util.ConcurrentModificationException??

??????JDK6???

????public class ConcurrentModificationException

????extends RuntimeException

????????????????????????????????????????????????????

???????磬???????? Collection ????е???????????????????????????? Collection?????????Щ????£??????????????????????????????????Щ?????????????? JRE ??????????? collection ??????????????????????иò???????????????????? ?????????????????????????????????e?????????????????????????????????

???????????????????????????????? ?????????????????????Υ??????Э??????????????У??????????????????????磬?????????????????????? collection ????????????? collection????????????????????

???????????????????????????????????????????????????????????????????????????κ???????????????????????????? ConcurrentModificationException??????????????????????????д???????????????????????????????????? ???ConcurrentModificationException ??y??????? bug??

????Java?е?For each???????????iterator???д???????iterator????????????iterator??????????????????for each????????????????????????????iterator?????ConcurrentModificationException??

????????????????????????for??????

    for(int i=0;i<source.size();i++){ 
            SharedBoardSmsWrapper tmpSharedBoardSmsWrapper=source.get(i); 
            for(int j=0;j<blackNameList.size();j++){ 
                BlackNameListModel tmpBlackNameListModel=blackNameList.get(j); 
                if(tmpSharedBoardSmsWrapper.getSource().equals(tmpBlackNameListModel.getSource())){ 
                   source.remove(tmpSharedBoardSmsWrapper); 
                   break; 
                } 
            } 
        }

for(int i=0;i<source.size();i++){         SharedBoardSmsWrapper tmpSharedBoardSmsWrapper=source.get(i);         for(int j=0;j<blackNameList.size();j++){             BlackNameListModel tmpBlackNameListModel=blackNameList.get(j);             if(tmpSharedBoardSmsWrapper.getSource().equals(tmpBlackNameListModel.getSource())){                source.remove(tmpSharedBoardSmsWrapper);                break;             }         }     }

????????????????????????????????2???…

?????Σ???????£????????????ò????