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

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.3.2
    • Fix Version/s: Patch Needed, Discussion
    • Component/s: lang.*
    • Labels:
      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

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

              Dates

              • Created:
                Updated: