Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8244342

Compilation warnings about unexpected serialization related method signatures.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 15
    • Fix Version/s: 15
    • Component/s: xml
    • Subcomponent:
    • Resolved In Build:
      b24
    • Verification:
      Not verified

      Description

      A work-in-progress serialization focused annotation processor produced the following warnings about unexpected serialization related method declarations.

      /ws/jdk-dev/open/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java:
           297: warning: Serialization-related method writeObject(java.io.ObjectOutputStream) in CLASS com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl has unexpected throws clause including java.lang.ClassNotFoundException

        --- Remove ClassNotFoundException, it can not be thrown in writeObject

      /ws/jdk-dev/open/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationImpl.java:
          1860: warning: Serialization-related method writeReplace() in CLASS com.sun.org.apache.xerces.internal.jaxp.datatype.DurationImpl has unexpected throws clause including java.io.IOException

       -- Remove throws IOException; writeReplace does not do any IO to throw an exception.


      Throwing declared exceptions in ReadObject, does not have the desired effect. ClassNotFoundException does not need to be converted to a different exception.

       -- add ClassNotFoundException to the throws clause
       -- Remove the try {} catch (ClassNotFoundException x) {}.


      /ws/jdk-dev/open/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/LocPathIterator.java:
          136: warning: Serialization-related method readObject(java.io.ObjectInputStream) in CLASS com.sun.org.apache.xpath.internal.axes.LocPathIterator has unexpected throws clause including javax.xml.transform.TransformerException

      /ws/jdk-dev/open/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/PredicatedNodeTest.java:
          69: warning: Serialization-related method readObject(java.io.ObjectInputStream) in CLASS com.sun.org.apache.xpath.internal.axes.PredicatedNodeTest has unexpected throws clause including javax.xml.transform.TransformerException

      /ws/jdk-dev/open/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/axes/UnionPathIterator.java:
          260: warning: Serialization-related method readObject(java.io.ObjectInputStream) in CLASS com.sun.org.apache.xpath.internal.axes.UnionPathIterator has unexpected throws clause including javax.xml.transform.TransformerException

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                joehw Joe Wang
                Reporter:
                rriggs Roger Riggs
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: