• About
Triona Weblog

Software Development and much more

foreach

QuickFix: ConcurrentModificationException beim Löschen in einer For-Schleife

07.03.2013 by Anton Autor

Ein altbekanntes Problem. Man iteriert in einer For-Each-Schleife über das KeySet einer Map und möchte einzelne Elemente aus der Map über eine eigene Methode löschen: private Map keyValueMap = new HashMap(); public void removeAll() { for (String key : keyValueMap.keySet()) { if (key == something) { remove(key); } } } public void remove(String key) { … [Read more…]

Views: 21178
Posted in: Collections, Development, Java Tagged: concurrent, concurrentmodificationexception, for, for each, foreach, hashmap, hashset, iterator, keyset, Map, Set
January 2023
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
3031  
« Nov    

Tags

API Architecture CDI Collections Comparable Comparator Database EA Eclipse EJB Enterprise Architect Excel Hessian HTML Iteration Java Java 8 Java EE JavaEE Java Enterprise Development javascript JEE JEE 6 JPA jQuery JSF linux Makro Map MariaDB Maven Oracle Plugins Relation relationship Richfaces Security Service Service Facade Set SOA Subversion Tutorial VBA XML

Recent Posts

  • Domain Driven Design und Event Storming
  • NESTJS BEYOND „HELLO WORLD“
  • Jakarta EE 9 – An upheaval with difficulties
  • Jakarta EE 9 – Ein Umbruch mit Schwierigkeiten
  • Erste Schritte mit Hibernate Spatial

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Copyright © 2023 Triona Weblog.

Impressum | Datenschutzerklärung