You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2004/06/23 05:41:05 UTC

cvs commit: xml-xerces/java/src/org/apache/xml/serialize BaseMarkupSerializer.java DOMSerializerImpl.java

mrglavas    2004/06/22 20:41:05

  Modified:    java/src/org/apache/xml/serialize BaseMarkupSerializer.java
                        DOMSerializerImpl.java
  Log:
  Eliminate some new compiler warnings emitted when compiling with
  J2SE 1.5.0 beta2. java.lang.Class.getMethod() and
  java.lang.reflect.Method.invoke() now take a varargs parameter.
  
  Casting null to Class[] and Object[] to suppress these warnings
  as the compiler suggests in order to make it explicitly clear that these
  are non-varargs calls.
  
  Revision  Changes    Path
  1.55      +5 -5      xml-xerces/java/src/org/apache/xml/serialize/BaseMarkupSerializer.java
  
  Index: BaseMarkupSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xml/serialize/BaseMarkupSerializer.java,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- BaseMarkupSerializer.java	14 May 2004 19:37:53 -0000	1.54
  +++ BaseMarkupSerializer.java	23 Jun 2004 03:41:05 -0000	1.55
  @@ -1201,18 +1201,18 @@
                       String docTypePublicId = null;
                       String docTypeSystemId = null;
                       try {
  -                        java.lang.reflect.Method getPublicId = docTypeClass.getMethod("getPublicId", null);
  +                        java.lang.reflect.Method getPublicId = docTypeClass.getMethod("getPublicId", (Class[]) null);
                           if (getPublicId.getReturnType().equals(String.class)) {
  -                            docTypePublicId = (String)getPublicId.invoke(docType, null);
  +                            docTypePublicId = (String)getPublicId.invoke(docType, (Object[]) null);
                           }
                       }
                       catch (Exception e) {
                           // ignore
                       }
                       try {
  -                        java.lang.reflect.Method getSystemId = docTypeClass.getMethod("getSystemId", null);
  +                        java.lang.reflect.Method getSystemId = docTypeClass.getMethod("getSystemId", (Class[]) null);
                           if (getSystemId.getReturnType().equals(String.class)) {
  -                            docTypeSystemId = (String)getSystemId.invoke(docType, null);
  +                            docTypeSystemId = (String)getSystemId.invoke(docType, (Object[]) null);
                           }
                       }
                       catch (Exception e) {
  
  
  
  1.26      +9 -9      xml-xerces/java/src/org/apache/xml/serialize/DOMSerializerImpl.java
  
  Index: DOMSerializerImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xml/serialize/DOMSerializerImpl.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- DOMSerializerImpl.java	28 May 2004 03:31:43 -0000	1.25
  +++ DOMSerializerImpl.java	23 Jun 2004 03:41:05 -0000	1.26
  @@ -468,7 +468,7 @@
           try {
               getVersion = doc.getClass().getMethod("getXmlVersion", new Class[]{});
               if(getVersion != null ) {
  -                ver = (String)getVersion.invoke(doc, null);
  +                ver = (String)getVersion.invoke(doc, (Object[]) null);
               }
           } catch (Exception e) {
               // no way to test the version...
  @@ -674,7 +674,7 @@
           try {
               getVersion = fDocument.getClass().getMethod("getXmlVersion", new Class[] {});
               if (getVersion != null) {
  -                ver = (String) getVersion.invoke(fDocument, null);
  +                ver = (String) getVersion.invoke(fDocument, (Object[]) null);
               }
           } catch (Exception e) {
               //no way to test the version...
  @@ -699,7 +699,7 @@
                   Method getEncoding =
                       fDocument.getClass().getMethod("getInputEncoding", new Class[] {});
                   if (getEncoding != null) {
  -                    encoding = (String) getEncoding.invoke(fDocument, null);
  +                    encoding = (String) getEncoding.invoke(fDocument, (Object[]) null);
                   }
               } catch (Exception e) {
                   // ignore the exception
  @@ -709,7 +709,7 @@
                       Method getEncoding =
                           fDocument.getClass().getMethod("getXmlEncoding", new Class[] {});
                       if (getEncoding != null) {
  -                        encoding = (String) getEncoding.invoke(fDocument, null);
  +                        encoding = (String) getEncoding.invoke(fDocument, (Object[]) null);
                       }
                   } catch (Exception e) {
                       // ignore the exception
  @@ -873,7 +873,7 @@
               getXmlVersion =
                   fDocument.getClass().getMethod("getXmlVersion", new Class[] {});
               if (getXmlVersion != null) {
  -                ver = (String) getXmlVersion.invoke(fDocument, null);
  +                ver = (String) getXmlVersion.invoke(fDocument, (Object[]) null);
               }
           } catch (Exception e) {
               // no way to test the version...
  @@ -895,7 +895,7 @@
               Method getEncoding =
                   fDocument.getClass().getMethod("getInputEncoding", new Class[] {});
               if (getEncoding != null) {
  -                encoding = (String) getEncoding.invoke(fDocument, null);
  +                encoding = (String) getEncoding.invoke(fDocument, (Object[]) null);
               }
           } catch (Exception e) {
               // ignore the exception
  @@ -905,7 +905,7 @@
                   Method getEncoding =
                       fDocument.getClass().getMethod("getXmlEncoding", new Class[] {});
                   if (getEncoding != null) {
  -                    encoding = (String) getEncoding.invoke(fDocument, null);
  +                    encoding = (String) getEncoding.invoke(fDocument, (Object[]) null);
                   }
               } catch (Exception e) {
                   // ignore the exception
  @@ -1007,7 +1007,7 @@
               try {
                   versionChanged = document.getClass().getMethod("isXMLVersionChanged()", new Class[] {});
                   if (versionChanged != null) {
  -                    verifyNames = ((Boolean)versionChanged.invoke(document, null)).booleanValue();
  +                    verifyNames = ((Boolean)versionChanged.invoke(document, (Object[]) null)).booleanValue();
                   }
               } catch (Exception e) {
                   //no way to test the version...
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org