Hi,
I'm getting a ConcurrentModificationException when attempting to parse a JSON string on a high-volume server hosted on AppEngine.
Here is the calling source code, run in a single thread:
Gson gson = new Gson();
Type mapType = new TypeToken<Map<String, MyValueObject>>(){}.getType();
Map<String, MyValueObject> stringToMyValueObject = gson.fromJson(stringToMyValueObjectJSON, mapType);
And here is the error I'm getting:
java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:782)
at java.util.ArrayList$Itr.next(ArrayList.java:754)
at com.google.apphosting.runtime.security.preverifier.intercept.NameTranslator.hasMirrorMethod(NameTranslator.java:233)
at com.google.apphosting.runtime.security.preverifier.PreVerifier.testNamespace(PreVerifier.java:387)
at com.google.apphosting.runtime.security.preverifier.PreVerifier.getUnmirroredClass(PreVerifier.java:349)
at com.google.apphosting.runtime.security.ExceptionScrubber$PreVerifierMirrorLookup.getUnmirroredClass(ExceptionScrubber.java:439)
at com.google.apphosting.runtime.security.ExceptionScrubber.getUnmirroredFrame(ExceptionScrubber.java:387)
at com.google.apphosting.runtime.security.ExceptionScrubber.scrubFrames(ExceptionScrubber.java:338)
at com.google.apphosting.runtime.security.ExceptionScrubber.scrubException_(ExceptionScrubber.java:143)
at com.google.apphosting.runtime.security.ExceptionScrubber.scrubException(ExceptionScrubber.java:115)
at com.google.apphosting.runtime.security.ExceptionScrubber.logScrubAndThrow(ExceptionScrubber.java:275)
at com.google.apphosting.runtime.security.shared.RuntimeVerifier.logScrubAndThrowException(RuntimeVerifier.java:440)
at com.google.apphosting.runtime.security.shared.intercept.java.lang.Class_.getConstructor(Class_.java:605)
at com.google.apphosting.runtime.security.shared.intercept.java.lang.Class_.getDeclaredConstructor(Class_.java:279)
at com.google.gson.internal.ConstructorConstructor.newDefaultConstructor(ConstructorConstructor.java:82)
at com.google.gson.internal.ConstructorConstructor.get(ConstructorConstructor.java:66)
at com.google.gson.internal.bind.MapTypeAdapterFactory.create(MapTypeAdapterFactory.java:128)
at com.google.gson.Gson.getAdapter(Gson.java:353)
at com.google.gson.Gson.fromJson(Gson.java:794)
at com.google.gson.Gson.fromJson(Gson.java:761)
at com.google.gson.Gson.fromJson(Gson.java:710)
Am I doing something wrong, or is this a Gson bug?
Thanks!
sheldon