You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by di...@apache.org on 2004/01/15 19:26:03 UTC
cvs commit: ws-axis/java/src/org/apache/axis/description TypeDesc.java
dims 2004/01/15 10:26:03
Modified: java/src/org/apache/axis/description TypeDesc.java
Log:
Fix for Bug 26078 - Java objects initialization code created using WSDL generator is not thread safe
Revision Changes Path
1.37 +15 -13 ws-axis/java/src/org/apache/axis/description/TypeDesc.java
Index: TypeDesc.java
===================================================================
RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/description/TypeDesc.java,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- TypeDesc.java 10 Nov 2003 13:50:56 -0000 1.36
+++ TypeDesc.java 15 Jan 2004 18:26:03 -0000 1.37
@@ -488,21 +488,23 @@
* @return Map with key=propertyName, value=descriptor
*/
public Map getPropertyDescriptorMap() {
- // Return map if already set.
- if (propertyMap != null) {
- return propertyMap;
- }
+ synchronized (this) {
+ // Return map if already set.
+ if (propertyMap != null) {
+ return propertyMap;
+ }
- // Make sure properties exist
- if (propertyDescriptors == null) {
- getPropertyDescriptors();
- }
+ // Make sure properties exist
+ if (propertyDescriptors == null) {
+ getPropertyDescriptors();
+ }
- // Build the map
- propertyMap = new HashMap();
- for (int i = 0; i < propertyDescriptors.length; i++) {
- BeanPropertyDescriptor descriptor = propertyDescriptors[i];
- propertyMap.put(descriptor.getName(), descriptor);
+ // Build the map
+ propertyMap = new HashMap();
+ for (int i = 0; i < propertyDescriptors.length; i++) {
+ BeanPropertyDescriptor descriptor = propertyDescriptors[i];
+ propertyMap.put(descriptor.getName(), descriptor);
+ }
}
return propertyMap;
}