commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 27876] New: - [lang] ReflectionToStringBuilder.toString(null) throws exception by design
Date Tue, 23 Mar 2004 18:05:38 GMT
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


Mime
View raw message