Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-4646

Incorrect formatting on String built by ValidatorException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.3-next-M8, 4.0.1
    • 2.3.11, 4.0.2, 2.3-next-M9, 4.1.0-RC1, 5.0.0
    • None
    • None

    Description

      See this example test:

      @Test
      public void facesMessageEmptyDetail()
      {
          FacesMessage message = new FacesMessage("Summary", "");
          ValidatorException exception = new ValidatorException(message);
      
          assertEquals("Summary", exception.getMessage());
      } 

       

      It currenty fails as the Exception message being built is "Summary: " because ValidatorException#facesMessageToString only only checks for null, empty strings are not being taken care of.
      Actually, if you create a FacesMessage with detail=null it will return the summary as the detail

      Attachments

        Activity

          People

            Unassigned Unassigned
            jungm Markus Jung
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: