Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-79

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0
    • 2.1
    • None
    • None
    • Operating System: All
      Platform: All

    • 27876

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ggregory Gary D. Gregory
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: