I just got an off-line question about 1.x not building with JDK 5, and it looks like this is being caused by revision 895646 which introduces JDK 6.0 specific code (isEmpty()).
I'm going to fix this by removing the JDK 6 specific code, but wanted to take the opportunity to check if we have reached any conclusion on the JDK 5 versus JDK 6 thread... it seems that people are still using JDK 5 and we should try to maintain backward compatibility on this area. On Mon, Jan 4, 2010 at 6:47 AM, <[email protected]> wrote: > Author: slaws > Date: Mon Jan 4 14:47:16 2010 > New Revision: 895646 > > URL: http://svn.apache.org/viewvc?rev=895646&view=rev > Log: > TUSCANY-3408 Generate referenced namespace shortname if it's not already > present > > Modified: > > tuscany/sca-java-1.x/trunk/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java > > Modified: > tuscany/sca-java-1.x/trunk/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java > URL: > http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java?rev=895646&r1=895645&r2=895646&view=diff > ============================================================================== > --- > tuscany/sca-java-1.x/trunk/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java > (original) > +++ > tuscany/sca-java-1.x/trunk/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java > Mon Jan 4 14:47:16 2010 > @@ -549,7 +549,15 @@ > defaultNamespaceSchema = xsDef; > } > } > - } > + } > + > + // useful for debugging DOM issues > + //System.out.println("======================= Schema DOM Pre > Merge=======================" ); > + //for (XSDefinition xsDef : wsdlDefinition.getXmlSchemas()) { > + // if (xsDef.getDocument() != null) { > + // printDOM(xsDef.getDocument()); > + // } > + //} > > // TUSCANY-3283 merge the no namespace schema into the default > namespace schema > if (noNamespaceSchema != null && defaultNamespaceSchema != null){ > @@ -558,11 +566,19 @@ > // merge the schema with no namespace into the schema with the > default namspace for this WSDL > mergeSchema(noNamespaceSchema, defaultNamespaceSchema, > wsdlDefinition.getXmlSchemas()); > > + // useful for debugging DOM issues > + //System.out.println("======================= Schema DOM Post > Merge=======================" ); > + //for (XSDefinition xsDef : wsdlDefinition.getXmlSchemas()) { > + // if (xsDef.getDocument() != null) { > + // printDOM(xsDef.getDocument()); > + // } > + //} > + > schemaCollection = new XmlSchemaCollection(); > defaultNamespaceSchema.setSchema(null); > defaultNamespaceSchema.setSchemaCollection(null); > loadXSD(schemaCollection, defaultNamespaceSchema); > - } > + } > > // push the schema into the WSDL > for (XSDefinition xsDef: wsdlDefinition.getXmlSchemas()){ > @@ -570,7 +586,7 @@ > } > > // useful for debugging DOM issues > - //System.out.println("======================= Schema DOM > =======================" ); > + //System.out.println("======================= Schema DOM Process End > =======================" ); > //for (XSDefinition xsDef : wsdlDefinition.getXmlSchemas()) { > // if (xsDef.getDocument() != null) { > // printDOM(xsDef.getDocument()); > @@ -720,6 +736,14 @@ > if (type != null && > type.getNodeValue().equals(typeName)){ > if > (xsDef.getNamespace().equals(defaultNamespace)){ > + // double check that there is a "tns" > namespace shortname specified > + String tnsNamespace = > refSchema.getDocumentElement().getAttributeNS("http://www.w3.org/2000/xmlns/", > "xmlns:tns"); > + > + if (tnsNamespace == null || > + tnsNamespace.isEmpty()){ > + > refSchema.getDocumentElement().setAttributeNS("http://www.w3.org/2000/xmlns/", > "xmlns:tns", defaultNamespace); > + } > + > // just add "tns" in front of the type > name as > // we have merged the type into this schema > type.setNodeValue("tns:" + > type.getNodeValue()); > > > -- Luciano Resende http://people.apache.org/~lresende http://lresende.blogspot.com/
