Menu

#1368 SOAPMessage.getSOAPHeader() can and does return null; test is incorrect

3.x
closed-fixed
None
5
2015-04-08
2015-03-13
bje
No

javax.xml.soap.SOAPMessage.getSOAPHeader() is recorded in jdkBaseNonnullReturn.db as never returning null, but it can and will do so when a header has been deleted from the SOAP body, as per the JDK documentation. This results in incorrect assertions by findbugs that a null check is unnecessary. Bug present in 3.0.1 release.

Discussion

  • Tagir Valeev

    Tagir Valeev - 2015-03-13

    Could you please provide exact link to the documentation where it says that null can be returned?

    I'm reading here:
    public SOAPHeader getSOAPHeader()
    throws SOAPException

    Gets the SOAP Header contained in this SOAPMessage object.

    Returns:
    the SOAPHeader object contained by this SOAPMessage object
    Throws:
    SOAPException - if the SOAP Header does not exist or cannot be retrieved

    It says that exception will be thrown if SOAP header does not exist.

     
  • William Pugh

    William Pugh - 2015-04-08
    • status: open --> closed-fixed
    • assigned_to: William Pugh
     
  • William Pugh

    William Pugh - 2015-04-08

    thanks.

     

Log in to post a comment.

MongoDB Logo MongoDB