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

ArrayUtils.toPrimitive(Object) does not support boolean and other types

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.11
    • Fix Version/s: 3.12.0
    • Component/s: lang.*
    • Labels:
      None

      Description

      ArrayUtils.toPrimitive(Object) supports only Integer, Long, Short, Double and Float. Boolean, Byte, and Character are not supported.

      This causes e.g. also calls to MethodUtils.invokeStaticMethod(...) to fail if e.g. a Boolean array is provided as the argument for a primitive boolean vararg because getVarArgs does expect ArrayUtils to do the right thing:

              if (varArgComponentType.isPrimitive()) {
                  // unbox from wrapper type to primitive type
                  varArgsArray = ArrayUtils.toPrimitive(varArgsArray);
              }
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rec Richard Eckart de Castilho

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 50m
                50m

                  Issue deployment