cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r760948 - in /cxf/trunk: api/src/main/java/org/apache/cxf/service/model/SchemaInfo.java rt/core/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java
Date Wed, 01 Apr 2009 16:16:36 GMT
Author: dkulp
Date: Wed Apr  1 16:16:35 2009
New Revision: 760948

URL: http://svn.apache.org/viewvc?rev=760948&view=rev
Log:
Put back the setElement call as SMX is using it.

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/service/model/SchemaInfo.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/service/model/SchemaInfo.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/SchemaInfo.java?rev=760948&r1=760947&r2=760948&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/service/model/SchemaInfo.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/service/model/SchemaInfo.java Wed Apr  1 16:16:35
2009
@@ -44,7 +44,7 @@
     private String systemId;
     // Avoid re-serializing all the time. Particularly as a cached WSDL will
     // hold a reference to the element.
-    private SoftReference<Element> cachedElement = new SoftReference<Element>(null);
+    private SoftReference<Element> cachedElement;
     
     public SchemaInfo(String namespaceUri) {
         this(namespaceUri, false, false);
@@ -75,13 +75,17 @@
         this.namespaceUri = nsUri;
     }
 
+    public synchronized void setElement(Element el) {
+        cachedElement = new SoftReference<Element>(el);
+    }
+    
     /**
      * Build and return a DOM tree for this schema.
      * @return
      */
     public synchronized Element getElement() {
         // if someone recently used this DOM tree, take advantage.
-        Element element = cachedElement.get();
+        Element element = cachedElement == null ? null : cachedElement.get();
         if (element != null) {
             return element;
         }

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java?rev=760948&r1=760947&r2=760948&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java Wed Apr  1 16:16:35
2009
@@ -126,6 +126,7 @@
                         SchemaInfo schemaInfo = new SchemaInfo(xmlSchema.getTargetNamespace());
                         schemaInfo.setSchema(xmlSchema);
                         schemaInfo.setSystemId(systemId);
+                        schemaInfo.setElement(schemaElem);
                         schemaInfos.add(schemaInfo);
                         schemaCount++;
                     }



Mime
View raw message