728x90 반응형 SMALL 2019/05/212 ConcurrentModificationException 데이터를 순회하면서 특정 data를 조작(삭제)하고 싶을 때 발생한다. Iterator it = map.entrySet().iterator(); while (it.hasNext()) { Entry entry = it.next(); if (entry != null && entry.getValue().compareTo(actualExpiredTime) < 0) { map.remove(entry.getKey()); } } Java 공식 문서를 보면 Iterator 의 remove를 이용하는 것이 Collection을 순회하면서 element를 삭제하는 유일하게 안전한 방법이라고 가이드 하고 있다. 그래서 소스코드를 바꿔본다. Iterator it = map.entrySet().iterator(); while .. 2019. 5. 21. 영어회화 - 100일의 기적 #12 I'd like to put my car on the market. Are you sure? What's the deal? We don't need two cars anymore. What if you have the car, and I have to go shopping? We need to cut back on shopping. Honey, I think you should just calm down a little bit. 내 차를 시장에 내놓으려고 해. 정말이야?? 대체 무슨 일인데? 더 이상 자동차가 두 대나 필요 없잖아. 당신이 차를 쓰고 있는데 내가 쇼핑 가야 되면 어떡해? 우린 쇼핑을 좀 줄여야 햅 자기야. 당신 잠시 진정 좀 해야 할 것 같아. *주요표현 What's the deal? 무.. 2019. 5. 21. 이전 1 다음 728x90 반응형 LIST