WMS GetCapabilities throws ConcurrentModificationException

Description

WMS GetCapabilities requests will throw a ConcurrentModificationException.

In my environment, this is 100% reproducible by making the GetCapabilities request without any configuration modifications happening.
Based upon my understanding, I believe the error happens whenever the inner if block removes an element from the map.
The bug should only impact some custom dimensions.
https://stackoverflow.com/questions/49688057/can-i-use-keyset-to-modify-hashmap-during-iteration

Environment

None

Status

Assignee

Andrea Aime

Reporter

Jerry Wilwerding

Triage

Fix versions

Affects versions

Priority

Medium
Configure