Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 75622 invoked from network); 17 Oct 2010 02:28:35 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 17 Oct 2010 02:28:35 -0000 Received: (qmail 68643 invoked by uid 500); 17 Oct 2010 02:28:35 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 68594 invoked by uid 500); 17 Oct 2010 02:28:35 -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 68587 invoked by uid 99); 17 Oct 2010 02:28:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 17 Oct 2010 02:28:35 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED 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; Sun, 17 Oct 2010 02:28:33 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 55ACF23889FD; Sun, 17 Oct 2010 02:27:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1023407 - /cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/XmlSchemaUtils.java Date: Sun, 17 Oct 2010 02:27:36 -0000 To: commits@cxf.apache.org From: bimargulies@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101017022736.55ACF23889FD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: bimargulies Date: Sun Oct 17 02:27:35 2010 New Revision: 1023407 URL: http://svn.apache.org/viewvc?rev=1023407&view=rev Log: Fix schema issues with rt/javascript Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/XmlSchemaUtils.java Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/XmlSchemaUtils.java URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/XmlSchemaUtils.java?rev=1023407&r1=1023406&r2=1023407&view=diff ============================================================================== --- cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/XmlSchemaUtils.java (original) +++ cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/XmlSchemaUtils.java Sun Oct 17 02:27:35 2010 @@ -84,7 +84,7 @@ public final class XmlSchemaUtils { */ public static void setElementName(XmlSchemaElement element, String name) { if (name != null - && element.getRef().getTarget() != null + && element.isRef() && !element.getRef().getTargetQName().getLocalPart().equals(name) && (element.getQName() == null || element.getQName().getLocalPart().equals(name))) { LOG.severe("Attempt to set the name of an element with a reference name."); @@ -409,7 +409,7 @@ public final class XmlSchemaUtils { } XmlSchemaElement originalElement = element; - while (element.getSchemaType() == null && element.getRef().getTarget() != null) { + while (element.getSchemaType() == null && element.isRef()) { /* * This code assumes that all schemas are in the collection. */ @@ -475,7 +475,7 @@ public final class XmlSchemaUtils { public static XmlSchemaElement getReferredElement(XmlSchemaElement element, SchemaCollection xmlSchemaCollection) { - if (element.getRef() != null) { + if (element.isRef()) { /* * Calling getTarget works if everything is in the collection already. */ @@ -508,7 +508,7 @@ public final class XmlSchemaUtils { } public static boolean isAttributeNameQualified(XmlSchemaAttribute attribute, XmlSchema schema) { - if (attribute.getRef() != null) { + if (attribute.isRef()) { throw new RuntimeException("isElementNameQualified on element with ref="); } if (attribute.getForm().equals(XmlSchemaForm.QUALIFIED)) { @@ -545,7 +545,7 @@ public final class XmlSchemaUtils { if (attribute.getQName() == null) { throw new RuntimeException("getSchemaQualifier on anonymous element."); } - if (attribute.getRef() != null) { + if (attribute.isRef()) { throw new RuntimeException("getSchemaQualified on the 'from' side of ref=."); } @@ -564,7 +564,7 @@ public final class XmlSchemaUtils { } public static boolean isElementNameQualified(XmlSchemaElement element, XmlSchema schema) { - if (element.getRef() != null) { + if (element.isRef()) { throw new RuntimeException("isElementNameQualified on element with ref="); } if (element.getForm().equals(XmlSchemaForm.QUALIFIED)) { @@ -602,7 +602,7 @@ public final class XmlSchemaUtils { if (qn == null) { throw new RuntimeException("isElementQualified on anonymous element."); } - if (element.getRef() != null) { + if (element.isRef()) { throw new RuntimeException("isElementQualified on the 'from' side of ref=."); }