Made TypeName.findOrCreate thread-safe

This commit is contained in:
Andreas Sewe 2013-05-07 18:27:13 +02:00 committed by Manu Sridharan
parent 30686135da
commit d0b5e8ddd2
1 changed files with 1 additions and 1 deletions

View File

@ -43,7 +43,7 @@ public final class TypeName implements Serializable {
*/
private final static Map<TypeNameKey, TypeName> map = HashMapFactory.make();
private static TypeName findOrCreate(TypeNameKey t) {
private static synchronized TypeName findOrCreate(TypeNameKey t) {
TypeName result = map.get(t);
if (result == null) {
result = new TypeName(t);