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

Improve internationalisation by accepting more than one possible true string value in BooleanUtils.toBoolean()

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.3.2
    • Patch Needed, Discussion
    • lang.*
    • None

    Description

      As part of a recent ML discussion it was noted that BooleanUtils.toBoolean(String) is biased towards English speakers.

      We could match the behaviour of this method for non-English users by adding:

      boolean toBoolean(String str, String... trueStrings)
      

      and match in a case-insensitive fashion. Anything that doesn't match a true string is false.

      The current toBoolean(String) method would just be a special case of this new method, with the arguments toBoolean(str, "true", "on", "y", "t", "yes").

      Attachments

        Activity

          People

            Unassigned Unassigned
            dmjones500 Duncan Jones
            Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: