Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-1814

UISelectOne and UISelectMany's getValueChoices() should never return null

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 2.6.0.Final
    • 2.5.0.Final
    • UI - API
    • None

      <aslak> gastaldi: speaking of NPE.. Forge doesn't handle null from setValueVoices().. or rather get i guess
      <aslak> Choices :)
      <gastaldi> aslak, let me create a test for that 
      <aslak> it basically goes into a for(T choice: input.getValueChoices())
      <gastaldi> hum, getValueChoices() should never be null afaik 
      <gastaldi> are you setting it to be null somewhere?
      <aslak> setVlaueChoices(->return null)
      <lincolnthree> gastaldi: yeah I think we need to fix the null situation on UISelectOne and UISelectMany, you shouldn't be able to get null, only an empty list IMO
      <gastaldi> right 
      <lincolnthree> sorry, not UISelectOne, that could be null
      <lincolnthree> just UISelectMany
      <lincolnthree> and UIInputMany
      <lincolnthree> shoudl return empty lists
      <lincolnthree> empty iterables
      <lincolnthree> or  whatever
      <gastaldi> we're talking about ValueChoices, so I think that applies to UISelectOne as well?
      <lincolnthree> gastaldi: ah, yeah ValueChoices does apply to that
      <lincolnthree> gastaldi: in regard to getValues() i think that should never be null either should it?
      <lincolnthree> for UIInputMany and UISelectMany
      <lincolnthree> just empty
      <gastaldi> hm, yeah, I think it shouldn't 
      <gastaldi> to avoid NPEs
      

              rhn-support-ggastald George Gastaldi
              rhn-support-ggastald George Gastaldi
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: