[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-6817) Logging of strings containing the percent character broken

Hardy Ferentschik (JIRA) noreply at atlassian.com
Wed Nov 23 05:12:22 EST 2011


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6817?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44386#comment-44386 ] 

Hardy Ferentschik commented on HHH-6817:
----------------------------------------

See also http://lists.jboss.org/pipermail/hibernate-dev/2011-November/007307.html

> Logging of strings containing the percent character broken
> ----------------------------------------------------------
>
>                 Key: HHH-6817
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6817
>             Project: Hibernate Core
>          Issue Type: Bug
>    Affects Versions: 4.0.0.CR6
>         Environment: HSQLDB 2.2.6 snapshot
>            Reporter: Fred Toussi
>            Assignee: Sanne Grinovero
>            Priority: Blocker
>             Fix For: 4.0.0.next, 3.6.next
>
>
> The method AbstractTypeDescriptor#extractLoggableRepresentation(T value) does not escape the percent character. Possible workaround below:
> 	public String extractLoggableRepresentation(T value) {
>         if (value == null)
>             return null;
>         String stringValue = value.toString();
>         return stringValue.replace("%", "%%");
> 	}
> The return value is used for logging, where the string is used as the format argument to java.lang.String#format(String format, Object... args). The percent character is interpreted as a format identifier and causes an exception as what follows is not necessarily a valid format template.  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list