ConcurrentModificationException iterating over System.getProperties().entrySet()

Description

Have seen this once (and only once) after running for months without issue.

Caused by: java.util.ConcurrentModificationException
at java.util.Hashtable$Enumerator.next(Hashtable.java:1167)
at liquibase.changelog.ChangeLogParameters.<init>(ChangeLogParameters.java:37)
at liquibase.Liquibase.<init>(Liquibase.java:106)
at liquibase.integration.spring.SpringLiquibase.createLiquibase(SpringLiquibase.java:346)
at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:297)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$6.run(AbstractAutowireCapableBeanFactory.java:1504)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1502)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
... 14 more

I guess the System.getProperties() needs to be copied or clone() before iterating over as it is possible for the System properties to change at any time. clone on a Hashtable is synchronized so should be ok.

Environment

java version "1.7.0_55"
Java(TM) SE Runtime Environment (build 1.7.0_55-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)

Windows 7

Status

Assignee

Unassigned

Reporter

Paul Illingworth

Labels

None

Components

Fix versions

Affects versions

3.1.1

Priority

Major