Description
In XWikiHibernateStore#loadXWikiCollectionInternal we find the following code block (Line 1367 - 1382), collecting properties already handled by custom mapping:
List<String> handledProps = new ArrayList<String>(); try { ... handledProps = bclass.getCustomMappingPropertyList(context); for (String prop : handledProps) { if (((Map) map).get(prop) == null) { handledProps.remove(prop); } } } catch (Exception e) { }
Max one property can be removed from handledProps, the second java.util.ArrayList$Itr.next call after the first remove causes a ConcurrentModificationException. This potentially causes issues for partially custom-mapped classes (at least 2 fields).
This bug exists since at least 2.7.2 but can also be found in the current master branch. It was hard to notice and debug because the exception is catched but not logged, even unchecked ones due to catch (Exception e) (a really bad idea).