axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: ws-axis/java/src/org/apache/axis/description TypeDesc.java
Date Thu, 15 Jan 2004 18:26:03 GMT
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;
       }
  
  
  

Mime
View raw message