Commons Lang
  1. Commons Lang
  2. LANG-351

Extension to ClassUtils: Obtain the primitive class from a wrapper

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.4
    • Component/s: None
    • Labels:
      None

      Description

      For some tasks related to reflection and method invocation I need the counter part of the ClassUtils.primitiveToWrapper() method.

      My use case is that I need to invoke a method, and I only have the name and an array of parameter values (not the exact parameter types). So I have to check based on the types of the current parameters if a method signature is compatible. If the signature contains primitive types, the current parameter values will be wrapper types; these have to be unboxed.

      1. lang-351.patch
        6 kB
        Oliver Heger

        Activity

        Hide
        ggregory@seagullsw.com added a comment -

        Patch applied with new methods marked with @since 2.4.

        Show
        ggregory@seagullsw.com added a comment - Patch applied with new methods marked with @since 2.4.
        Hide
        Henri Yandell added a comment -

        Thanks Oliver. As there's a patch; adding to 2.3.1. We can rename that to 2.4 if necessary.

        Show
        Henri Yandell added a comment - Thanks Oliver. As there's a patch; adding to 2.3.1. We can rename that to 2.4 if necessary.
        Hide
        Oliver Heger added a comment -

        Patch with the implementation of the desired functionality and corresponding unit tests.

        Show
        Oliver Heger added a comment - Patch with the implementation of the desired functionality and corresponding unit tests.

          People

          • Assignee:
            Gary Gregory
            Reporter:
            Oliver Heger
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development