tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sl...@apache.org
Subject svn commit: r825973 - /tuscany/branches/sca-java-1.x/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java
Date Fri, 16 Oct 2009 16:04:28 GMT
Author: slaws
Date: Fri Oct 16 16:04:27 2009
New Revision: 825973

URL: http://svn.apache.org/viewvc?rev=825973&view=rev
Log:
TUSCANY-3303 slight change so that import delete looks through all the imports before actually
trying to delete any that need to be removed

Modified:
    tuscany/branches/sca-java-1.x/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java

Modified: tuscany/branches/sca-java-1.x/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java?rev=825973&r1=825972&r2=825973&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java
(original)
+++ tuscany/branches/sca-java-1.x/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java
Fri Oct 16 16:04:27 2009
@@ -687,6 +687,7 @@
 	            // look for any imports of the no namespace schema
 	            Document refSchema = xsDef.getDocument();
 	            NodeList imports = refSchema.getElementsByTagNameNS("http://www.w3.org/2001/XMLSchema","import");
+	            List<Node> importsToDelete = new ArrayList<Node>();
 	            
 	            for (int j = 0; j < imports.getLength(); j++){
 	                Element _import = (Element)imports.item(j);
@@ -695,13 +696,18 @@
 	                if (_import.getAttributes().getLength() == 0){
 	                    if (xsDef.getNamespace().equals(defaultNamespace)){
 	                        // remove the import
-	                        _import.getParentNode().removeChild(_import);                  
     
+	                        //_import.getParentNode().removeChild(_import);
+	                        importsToDelete.add(_import);
 	                    } else {
 	                        // update the import to refer to the default namespace
 	                        _import.setAttribute("namespace", defaultNamespace);
 	                    }
 	                }
 	            }
+	            
+	            for (Node _import : importsToDelete){
+	                _import.getParentNode().removeChild(_import);
+	            }
 	
 	            // look for any type attributes that refer to the 
 	            // node being merged



Mime
View raw message