1
1
/*
2
- * Copyright 2002-2010 the original author or authors.
2
+ * Copyright 2002-2011 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -80,13 +80,13 @@ public class TypeDescriptor {
80
80
81
81
private Object value ;
82
82
83
- private TypeDescriptor elementType ;
83
+ private volatile TypeDescriptor elementType ;
84
84
85
- private TypeDescriptor mapKeyType ;
85
+ private volatile TypeDescriptor mapKeyType ;
86
86
87
- private TypeDescriptor mapValueType ;
87
+ private volatile TypeDescriptor mapValueType ;
88
88
89
- private Annotation [] annotations ;
89
+ private volatile Annotation [] annotations ;
90
90
91
91
92
92
/**
@@ -266,7 +266,7 @@ public Class<?> getElementType() {
266
266
/**
267
267
* Return the element type as a type descriptor.
268
268
*/
269
- public synchronized TypeDescriptor getElementTypeDescriptor () {
269
+ public TypeDescriptor getElementTypeDescriptor () {
270
270
if (this .elementType == null ) {
271
271
this .elementType = forElementType (resolveElementType ());
272
272
}
@@ -309,15 +309,15 @@ public Class<?> getMapKeyType() {
309
309
/**
310
310
* Returns map key type as a type descriptor.
311
311
*/
312
- public synchronized TypeDescriptor getMapKeyTypeDescriptor () {
312
+ public TypeDescriptor getMapKeyTypeDescriptor () {
313
313
if (this .mapKeyType == null ) {
314
314
this .mapKeyType = forElementType (resolveMapKeyType ());
315
315
}
316
316
return this .mapKeyType ;
317
317
}
318
318
319
319
/**
320
- * Return the map key type as a type descriptor. If the key type is null
320
+ * Return the map key type as a type descriptor. If the key type is <code> null</code>
321
321
* (cannot be determined), the type descriptor is derived from the key argument.
322
322
* @param key the key
323
323
* @return the map key type descriptor
@@ -338,7 +338,7 @@ public Class<?> getMapValueType() {
338
338
/**
339
339
* Returns map value type as a type descriptor.
340
340
*/
341
- public synchronized TypeDescriptor getMapValueTypeDescriptor () {
341
+ public TypeDescriptor getMapValueTypeDescriptor () {
342
342
if (this .mapValueType == null ) {
343
343
this .mapValueType = forElementType (resolveMapValueType ());
344
344
}
@@ -359,7 +359,7 @@ public TypeDescriptor getMapValueTypeDescriptor(Object value) {
359
359
/**
360
360
* Obtain the annotations associated with the wrapped parameter/field, if any.
361
361
*/
362
- public synchronized Annotation [] getAnnotations () {
362
+ public Annotation [] getAnnotations () {
363
363
if (this .annotations == null ) {
364
364
this .annotations = resolveAnnotations ();
365
365
}
0 commit comments