[hibernate-issues] [Hibernate-JIRA] Commented: (HV-184) ResourceBundlerMessageInterpolator fails to meet the spec in some issues

Hardy Ferentschik (JIRA) noreply at atlassian.com
Fri Jul 17 06:41:15 EDT 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HV-184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=33623#action_33623 ] 

Hardy Ferentschik commented on HV-184:
--------------------------------------

There was a bug in the message interpolation which got fixed. 
testAppendReplacementNeedsToEscapeBackslashAndDollarSign() and testUnknownParametersShouldBePreserved() work fine now. That is if one changes the expected message in the former to "Message is US$ 5" which it should be, right?

Still investigating testCurlyBracesEscapingShouldBeRespected()

> ResourceBundlerMessageInterpolator fails to meet the spec in some issues
> ------------------------------------------------------------------------
>
>                 Key: HV-184
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-184
>             Project: Hibernate Validator
>          Issue Type: Bug
>          Components: engine, validators
>    Affects Versions: 4.0.0.Beta1
>         Environment: N/A
>            Reporter: Daniel Yokomizo
>            Assignee: Hardy Ferentschik
>            Priority: Blocker
>         Attachments: JavaxValidationBugsTest.java
>
>
> As I was developing a MessageInterpolator to provide additional interpolation capabilities I discovered that ResourceBundlerMessageInterpolator fails to preserve unknown message parameters (i.e. if the message parameter is not a key in any of the resource bundles and isn't an annotation attribute). Actually the spec is silent about this situation but I don't think the current behavior is intended.
> Additionally I discovered that ResourceBundlerMessageInterpolator also doesn't treat escaped curly braces as literals and it doesn't properly escape before calling java.util.regex.Matcher.appendReplacement(StringBuffer,String) and fails if the dollar sign (i.e. $) appears in certain places of the message.
> There's a JUnit 4 test case attached that shows the three symptoms and fails all tests (but it should pass for a correct implementation).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list