cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r825351 - /cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/SchemaCollection.java
Date Thu, 15 Oct 2009 00:26:00 GMT
Author: bimargulies
Date: Thu Oct 15 00:26:00 2009
New Revision: 825351

URL: http://svn.apache.org/viewvc?rev=825351&view=rev
Log:
Fix CXF-1837.

Modified:
    cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/SchemaCollection.java

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/SchemaCollection.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/SchemaCollection.java?rev=825351&r1=825350&r2=825351&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/SchemaCollection.java
(original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/common/xmlschema/SchemaCollection.java
Thu Oct 15 00:26:00 2009
@@ -20,7 +20,6 @@
 package org.apache.cxf.common.xmlschema;
 
 import java.io.Reader;
-import java.lang.reflect.Method;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
@@ -59,21 +58,9 @@
 import org.apache.ws.commons.schema.utils.TargetNamespaceValidator;
 
 /**
- * Wrapper class for XmlSchemaCollection that deals with various quirks and bugs. One bug
is WSCOMMONS-272.
+ * Wrapper class for XmlSchemaCollection that deals with various quirks and bugs.
  */
 public class SchemaCollection {
-    private static final Method GET_ELEMENT_BY_NAME_METHOD;
-    static {
-        Method m = null;
-        try {
-            m = XmlSchema.class.getMethod("getElementByName", new Class[] {
-                String.class
-            });
-        } catch (Exception ex) {
-            // ignore
-        }
-        GET_ELEMENT_BY_NAME_METHOD = m;
-    }
 
     private XmlSchemaCollection schemaCollection;
     private Map<XmlSchema, Set<XmlSchemaType>> xmlTypesCheckedForCrossImportsPerSchema

@@ -234,24 +221,10 @@
         for (XmlSchema schema : schemaCollection.getXmlSchemas()) {
             if (name.getNamespaceURI().equals(schema.getTargetNamespace())) {
 
-                // for XmlSchema 1.4, we should use:
-                // schema.getElementByName(name.getLocalPart()) != null
-                // but that doesn't exist in 1.3 so for now, use reflection
-                try {
-                    if (GET_ELEMENT_BY_NAME_METHOD != null) {
-                        if (GET_ELEMENT_BY_NAME_METHOD.invoke(schema, new Object[] {
-                            name.getLocalPart()
-                        }) != null) {
-                            return schema;
-                        }
-                    } else if (schema.getElementByName(name) != null) {
-                        return schema;
-                    }
-
-                } catch (java.lang.reflect.InvocationTargetException ex) {
-                    // ignore
-                } catch (IllegalAccessException ex) {
-                    // ignore
+                if (schema.getElementByName(name.getLocalPart()) != null) {
+                    return schema;
+                } else if (schema.getElementByName(name) != null) {
+                    return schema;
                 }
             }
         }



Mime
View raw message