I have many threads which are unmarshall xmls to objects. There is a map and some other fields in this class.
I realized that there are some cases where the content in the map is changed.
I created a simple unit test. Put a String into the map and into a field where the map is. Create 15 threads to marshall and unmarshall my object 1000 times.
After the test execution I realized that about in the 2% of the calls, the String in the map differs from the value in the field.
I add my test case.
There are some interesting things:
Here I create unmarshallers for all threads. But if I create new JAXBContext instance for each threads, the test passed, no errors.
Here if I uncomment the @XmlJavaTypeAdapter annotation, the test passed, no errors.