tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 10372] New: - SingleSignOn toString() throws NullPointerException
Date Mon, 01 Jul 2002 11:12:30 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10372>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10372

SingleSignOn toString() throws NullPointerException

           Summary: SingleSignOn toString() throws NullPointerException
           Product: Tomcat 4
           Version: 4.0 Beta 1
          Platform: Macintosh
               URL: N/A
        OS/Version: MacOS X
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: robertdonkin@mac.com


when the toString method is called when the container fields is null, a 
NullPointerException is thrown. (this is annoying since this exception is prevents use in

jboss.)  

this is caused by the toString() method not checking for a null value. at the moment we 
have:

    /**
     * Return a String rendering of this object.
     */
    public String toString() {

        StringBuffer sb = new StringBuffer("SingleSignOn[");
        sb.append(container.getName());
        sb.append("]");
        return (sb.toString());

    }

a simple check for null prevents this exception occuring. for example:

    /**
     * Return a String rendering of this object.
     */
    public String toString() {

        StringBuffer sb = new StringBuffer("SingleSignOn[");
        if (container != null) {
             sb.append(container.getName());
        }
        sb.append("]");
        return (sb.toString());

    }

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message