Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8299791

PropertyEditorSupport.setAsText(t) muzz validate 't' against String class

XMLWordPrintable

    • generic
    • generic

      A DESCRIPTION OF THE PROBLEM :
      PropertyEditorSupport.setAsText(t) validates internal field 'value' against String class, and sets it to 't' (by setValue(t)) when passed.
      Initially, the 'value' field is null, so even if provided parameter 't' is of String type, validation fails and internal 'value' remains null.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      new PropertyEditorSupport().setAsText("text");

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      ("text").equals(new PropertyEditorSupport().setAsText("text").getValue())
      ACTUAL -
      IllegalArgumentException

      CUSTOMER SUBMITTED WORKAROUND :
      use setValue() instead:
      PropertyEditorSupport().setValue("text")

      FREQUENCY : always


            pnarayanaswa Praveen Narayanaswamy
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: