Author: dims
Date: Tue Dec 25 12:40:01 2007
New Revision: 606810

URL: http://svn.apache.org/viewvc?rev=606810&view=rev
Log:
Fix for JDK1.4 breakage reported here - 
http://marc.info/?l=axis-dev&m=119858333309960&w=2


Modified:
    
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaCollection.java
    
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/utils/DOMUtil.java

Modified: 
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaCollection.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaCollection.java?rev=606810&r1=606809&r2=606810&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaCollection.java
 (original)
+++ 
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaCollection.java
 Tue Dec 25 12:40:01 2007
@@ -397,7 +397,7 @@
             TargetNamespaceValidator validator) {
         SchemaBuilder builder = new SchemaBuilder(this, validator);
         XmlSchema schema = builder.build(doc, uri, veh);
-        schema.setInputEncoding(doc.getInputEncoding());
+        schema.setInputEncoding(DOMUtil.getInputEncoding(doc));
                return schema;
     }
 

Modified: 
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/utils/DOMUtil.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/utils/DOMUtil.java?rev=606810&r1=606809&r2=606810&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/utils/DOMUtil.java
 (original)
+++ 
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/utils/DOMUtil.java
 Tue Dec 25 12:40:01 2007
@@ -588,7 +588,11 @@
         return node.getNamespaceURI();
     }
 
-    //why do we need to use reflection here??
+    /**
+     * Use reflection to call the getInputEncoding method, since this API is 
NOT present in JDK1.4
+     * @param doc
+     * @return
+     */
     public static String getInputEncoding(Document doc) {
         try {
             Method m = Document.class.getMethod("getInputEncoding", new 
Class[]{});
@@ -597,11 +601,16 @@
             return "UTF-8";
         }
     }
-    
-    //why do we need to use reflection here??
+
+    /**
+     * Use reflection to call the getXmlEncoding method, since this API is NOT 
present in JDK1.4
+     * @param doc
+     * @return
+     */
     public static String getXmlEncoding(Document doc) {
         try {
-            return doc.getXmlEncoding();
+            Method m = Document.class.getMethod("getXmlEncoding", new 
Class[]{});
+            return (String) m.invoke(doc, new Object[]{});
         } catch (Exception e) {
             return "UTF-8";
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to