added synchronization to the static element cache

This commit is contained in:
Timo Westkämper 2011-07-05 09:10:31 +00:00
parent 48eb4c4124
commit 9fcf0bce76

View File

@ -63,7 +63,8 @@ public class Processor {
/**
* Cache for annotated elements
*/
static final Map<Class<? extends Annotation>, Set<Element>> elementCache = new HashMap<Class<? extends Annotation>,Set<Element>>();
static final Map<Class<? extends Annotation>, Set<Element>> elementCache = Collections.synchronizedMap(
new HashMap<Class<? extends Annotation>,Set<Element>>());
/**
* Mapping of entity types to TypeElements which contribute to the generated class