[
https://issues.apache.org/jira/browse/MYFACES-4646?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Melloware resolved MYFACES-4646.
--------------------------------
Resolution: Fixed
> Incorrect formatting on String built by ValidatorException
> ----------------------------------------------------------
>
> Key: MYFACES-4646
> URL: https://issues.apache.org/jira/browse/MYFACES-4646
> Project: MyFaces Core
> Issue Type: Bug
> Affects Versions: 2.3-next-M8, 4.0.1
> Reporter: Markus Jung
> Priority: Minor
> Fix For: 2.3.11, 4.0.2, 2.3-next-M9, 4.1.0, 5.0.0
>
>
> See this example test:
> {code:java}
> @Test
> public void facesMessageEmptyDetail()
> {
> FacesMessage message = new FacesMessage("Summary", "");
> ValidatorException exception = new ValidatorException(message);
> assertEquals("Summary", exception.getMessage());
> } {code}
>
> It currenty fails as the Exception message being built is "Summary: " because
> ValidatorException#facesMessageToString only [only checks for
> null|https://github.com/apache/myfaces/blob/main/api/src/main/java/jakarta/faces/validator/ValidatorException.java#L78],
> 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|https://github.com/apache/myfaces/blob/main/api/src/main/java/jakarta/faces/application/FacesMessage.java#L218]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)