jenkinsci/tikal-multijob-plugin — pull request #33 by jglick (2013-11-05 19:01:19+00:00)
Title: Try to avoid a ConcurrentModificationException serializing subBuilds.

A user reported an exception that is at least in part due to a lack of thread safety in this plugin. The bottom part of the stack trace:

```
java.lang.RuntimeException: Failed to serialize com.tikal.jenkins.plugins.multijob.MultiJobBuild#subBuilds for class com.tikal.jenkins.plugins.multijob.MultiJobBuild
at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:208)
at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:176)
at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:135)
at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:161)
at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:102)
at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:217)
at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:204)
... 73 more
Caused by: java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:782)
at java.util.ArrayList$Itr.next(ArrayList.java:754)
at com.thoughtworks.xstream.converters.collections.CollectionConverter.marshal(CollectionConverter.java:54)
at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:217)
at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:204)
... 82 more
```

Perhaps `addSubBuild` was being called by a different thread than one that was serializing `build.xml`.