Uploaded image for project: 'Commons BeanUtils'
  1. Commons BeanUtils
  2. BEANUTILS-339

BeanUtilsBean.setProperty throws IllegalArgumentException if value is null

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 1.8.0-BETA
    • 1.8.1
    • Bean / Property Utils
    • None

    Description

      Line 1003-1004 conflicts with API doc: "If null is passed into a property expecting a primitive value, then this will be converted as if it were a null string."

      Line 1003 only tests if the value is null and 1004 explicitly casts to a String. If a bean has a field of any other type, i.e. java.util.Comparator, then this fails with:
      java.lang.IllegalArgumentException: Cannot invoke <myBean>.setComparator on bean class 'class <myBean>' - argument type mismatch - had objects of type "java.lang.String" but expected signature "java.util.Comparator"

      Attachments

        Issue Links

          Activity

            People

              niallp Niall Pemberton
              leet3lite Alan Escreet
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: