berndhopp / guice

guice-integration for the vaadin-framework
https://vaadin.com/directory#!addon/guice-vaadin-integration
10 stars 7 forks source link

FIX for Java 9+ ConcurrentModificationExc when initializing ViewScope Views #17

Closed meiko closed 5 years ago

meiko commented 5 years ago

Since Java 9 the behavior of HashMap::computeIfAbsent() has changed now: "ConcurrentModificationException - if it is detected that the mapping function modified this map"

When working with ViewScope-Views (injected into UIScope Views) a ConcurrentModificationException was thrown. This patch fixes this problem.

berndhopp commented 5 years ago

I feel there should be a better way to fix this. why is a concurrentModificationException thrown when there was no concurrent modification?

meiko commented 5 years ago

Yes you are right. Another problem ...