You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2004/03/23 19:05:38 UTC

DO NOT REPLY [Bug 27876] New: - [lang] ReflectionToStringBuilder.toString(null) throws exception by design

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=27876>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=27876

[lang] ReflectionToStringBuilder.toString(null) throws exception by design

           Summary: [lang] ReflectionToStringBuilder.toString(null) throws
                    exception by design
           Product: Commons
           Version: 2.0 Final
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Lang
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: ggregory@seagullsw.com


Calling ReflectionToStringBuilder.toString(null) throws an exception by design.
I  think it should just return null. Right now I need to do nasty things like:

    public String toString() {
        // dive into commons http client object as they do not implement toString().
        return new ToStringBuilder(this).append("url",
this.url).append("retryCount", this.retryCount).append(
                "multiThreadedHttpConnectionManager",
                this.multiThreadedHttpConnectionManager == null ? null :
ReflectionToStringBuilder
                        .toString(this.multiThreadedHttpConnectionManager)).append(
                "secureProtocolSocketFactory",
                this.secureProtocolSocketFactory == null ? null :
ReflectionToStringBuilder
                        .toString(this.secureProtocolSocketFactory)).toString();
    }

Will attach patch proposal.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org