Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 570 invoked from network); 30 May 2008 14:33:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 May 2008 14:33:24 -0000 Received: (qmail 16592 invoked by uid 500); 30 May 2008 14:33:26 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 16541 invoked by uid 500); 30 May 2008 14:33:26 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 16531 invoked by uid 99); 30 May 2008 14:33:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 May 2008 07:33:26 -0700 X-ASF-Spam-Status: No, hits=-1998.5 required=10.0 tests=ALL_TRUSTED,WEIRD_PORT X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 May 2008 14:32:46 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9CDA62388A0F; Fri, 30 May 2008 07:33:03 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r661735 - in /cxf/trunk: rt/core/src/main/java/org/apache/cxf/transport/http/ systests/src/test/java/org/apache/cxf/systest/jaxws/ testutils/src/main/java/org/apache/hello_world/ testutils/src/main/resources/wsdl/ testutils/src/main/resourc... Date: Fri, 30 May 2008 14:33:03 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080530143303.9CDA62388A0F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Fri May 30 07:33:02 2008 New Revision: 661735 URL: http://svn.apache.org/viewvc?rev=661735&view=rev Log: Try to prevent some infinite loops when using recursively imported schemas Added: cxf/trunk/testutils/src/main/resources/wsdl/others/hello_world_schema.xsd - copied, changed from r661554, cxf/trunk/testutils/src/main/resources/wsdl/hello_world_schema.xsd cxf/trunk/testutils/src/main/resources/wsdl/others/hello_world_schema2.xsd - copied, changed from r661554, cxf/trunk/testutils/src/main/resources/wsdl/hello_world_schema2.xsd Removed: cxf/trunk/testutils/src/main/resources/wsdl/hello_world_schema.xsd cxf/trunk/testutils/src/main/resources/wsdl/hello_world_schema2.xsd Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/OASISCatalogTest.java cxf/trunk/testutils/src/main/java/org/apache/hello_world/GreeterImpl.java cxf/trunk/testutils/src/main/resources/wsdl/others/hello_world_messages_catalog.wsdl Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java?rev=661735&r1=661734&r2=661735&view=diff ============================================================================== --- cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java (original) +++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java Fri May 30 07:33:02 2008 @@ -265,13 +265,15 @@ //check to see if it's already in a URL format. If so, leave it. new URL(start); } catch (MalformedURLException e) { - done.put(start, imp.getDefinition()); - updateDefinition(imp.getDefinition(), done, doneSchemas, base, ei); + if (done.put(start, imp.getDefinition()) == null) { + updateDefinition(imp.getDefinition(), done, doneSchemas, base, ei); + } } } else { - done.put(start, imp.getDefinition()); - done.put(resolvedSchemaLocation, imp.getDefinition()); - updateDefinition(imp.getDefinition(), done, doneSchemas, base, ei); + if (done.put(start, imp.getDefinition()) == null) { + done.put(resolvedSchemaLocation, imp.getDefinition()); + updateDefinition(imp.getDefinition(), done, doneSchemas, base, ei); + } } } } @@ -340,13 +342,15 @@ //check to see if it's already in a URL format. If so, leave it. new URL(start); } catch (MalformedURLException e) { - doneSchemas.put(start, imp); - updateSchemaImports(imp.getReferencedSchema(), doneSchemas, base); + if (doneSchemas.put(start, imp) == null) { + updateSchemaImports(imp.getReferencedSchema(), doneSchemas, base); + } } } else { - doneSchemas.put(start, imp); - doneSchemas.put(resolvedSchemaLocation, imp); - updateSchemaImports(imp.getReferencedSchema(), doneSchemas, base); + if (doneSchemas.put(start, imp) == null) { + doneSchemas.put(resolvedSchemaLocation, imp); + updateSchemaImports(imp.getReferencedSchema(), doneSchemas, base); + } } } } @@ -363,8 +367,9 @@ //check to see if it's aleady in a URL format. If so, leave it. new URL(start); } catch (MalformedURLException e) { - doneSchemas.put(start, included); - updateSchemaImports(included.getReferencedSchema(), doneSchemas, base); + if (doneSchemas.put(start, included) == null) { + updateSchemaImports(included.getReferencedSchema(), doneSchemas, base); + } } } } else if (!doneSchemas.containsKey(start) Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/OASISCatalogTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/OASISCatalogTest.java?rev=661735&r1=661734&r2=661735&view=diff ============================================================================== --- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/OASISCatalogTest.java (original) +++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/OASISCatalogTest.java Fri May 30 07:33:02 2008 @@ -59,19 +59,21 @@ Endpoint ep = Endpoint.publish(null, new GreeterImpl()); try { URL url = new URL("http://localhost:9000/SoapContext/SoapPort?" - + "xsd=testutils/hello_world_schema2.xsd"); + + "xsd=hello_world_schema2.xsd"); assertNotNull(url.getContent()); + String result = IOUtils.toString((InputStream)url.getContent()); + assertTrue(result, result.contains("xsd=hello_world_schema.xsd")); url = new URL("http://localhost:9000/SoapContext/SoapPort" - + "?xsd=testutils/hello_world_schema.xsd"); - String result = IOUtils.toString((InputStream)url.getContent()); - assertTrue(result.contains("xsd=testutils/hello_world_schema2.xsd")); + + "?xsd=hello_world_schema.xsd"); + result = IOUtils.toString((InputStream)url.getContent()); + assertTrue(result, result.contains("xsd=hello_world_schema2.xsd")); url = new URL("http://localhost:9000/SoapContext/SoapPort" + "?wsdl=testutils/others/hello_world_messages_catalog.wsdl"); result = IOUtils.toString((InputStream)url.getContent()); - assertTrue(result.contains("xsd=testutils/hello_world_schema.xsd")); + assertTrue(result, result.contains("xsd=hello_world_schema.xsd")); } finally { ep.stop(); Modified: cxf/trunk/testutils/src/main/java/org/apache/hello_world/GreeterImpl.java URL: http://svn.apache.org/viewvc/cxf/trunk/testutils/src/main/java/org/apache/hello_world/GreeterImpl.java?rev=661735&r1=661734&r2=661735&view=diff ============================================================================== --- cxf/trunk/testutils/src/main/java/org/apache/hello_world/GreeterImpl.java (original) +++ cxf/trunk/testutils/src/main/java/org/apache/hello_world/GreeterImpl.java Fri May 30 07:33:02 2008 @@ -30,6 +30,9 @@ wsdlLocation = "testutils/others/hello_world_services_catalog.wsdl") public class GreeterImpl implements Greeter { + public GreeterImpl() { + } + public String greetMe(String requestType) { return "Hello " + requestType; } Modified: cxf/trunk/testutils/src/main/resources/wsdl/others/hello_world_messages_catalog.wsdl URL: http://svn.apache.org/viewvc/cxf/trunk/testutils/src/main/resources/wsdl/others/hello_world_messages_catalog.wsdl?rev=661735&r1=661734&r2=661735&view=diff ============================================================================== --- cxf/trunk/testutils/src/main/resources/wsdl/others/hello_world_messages_catalog.wsdl (original) +++ cxf/trunk/testutils/src/main/resources/wsdl/others/hello_world_messages_catalog.wsdl Fri May 30 07:33:02 2008 @@ -29,7 +29,7 @@ + schemaLocation="hello_world_schema.xsd"/> Copied: cxf/trunk/testutils/src/main/resources/wsdl/others/hello_world_schema.xsd (from r661554, cxf/trunk/testutils/src/main/resources/wsdl/hello_world_schema.xsd) URL: http://svn.apache.org/viewvc/cxf/trunk/testutils/src/main/resources/wsdl/others/hello_world_schema.xsd?p2=cxf/trunk/testutils/src/main/resources/wsdl/others/hello_world_schema.xsd&p1=cxf/trunk/testutils/src/main/resources/wsdl/hello_world_schema.xsd&r1=661554&r2=661735&rev=661735&view=diff ============================================================================== --- cxf/trunk/testutils/src/main/resources/wsdl/hello_world_schema.xsd (original) +++ cxf/trunk/testutils/src/main/resources/wsdl/others/hello_world_schema.xsd Fri May 30 07:33:02 2008 @@ -24,7 +24,7 @@ elementFormDefault="qualified"> + schemaLocation="hello_world_schema2.xsd"/> Copied: cxf/trunk/testutils/src/main/resources/wsdl/others/hello_world_schema2.xsd (from r661554, cxf/trunk/testutils/src/main/resources/wsdl/hello_world_schema2.xsd) URL: http://svn.apache.org/viewvc/cxf/trunk/testutils/src/main/resources/wsdl/others/hello_world_schema2.xsd?p2=cxf/trunk/testutils/src/main/resources/wsdl/others/hello_world_schema2.xsd&p1=cxf/trunk/testutils/src/main/resources/wsdl/hello_world_schema2.xsd&r1=661554&r2=661735&rev=661735&view=diff ============================================================================== --- cxf/trunk/testutils/src/main/resources/wsdl/hello_world_schema2.xsd (original) +++ cxf/trunk/testutils/src/main/resources/wsdl/others/hello_world_schema2.xsd Fri May 30 07:33:02 2008 @@ -20,7 +20,11 @@ - - - + + + + + +