myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r935905 - /myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/DefaultMessageBuilder.java
Date Tue, 20 Apr 2010 13:26:48 GMT
Author: gpetracek
Date: Tue Apr 20 13:26:48 2010
New Revision: 935905

URL: http://svn.apache.org/viewvc?rev=935905&view=rev
Log:
cleanup

Modified:
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/DefaultMessageBuilder.java

Modified: myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/DefaultMessageBuilder.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/DefaultMessageBuilder.java?rev=935905&r1=935904&r2=935905&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/DefaultMessageBuilder.java
(original)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/DefaultMessageBuilder.java
Tue Apr 20 13:26:48 2010
@@ -24,9 +24,9 @@ import org.apache.myfaces.extensions.cdi
 import org.apache.myfaces.extensions.cdi.message.api.MessageContextConfigAware;
 import org.apache.myfaces.extensions.cdi.message.api.MessageResolver;
 import org.apache.myfaces.extensions.cdi.message.api.MessageInterpolator;
-import org.apache.myfaces.extensions.cdi.message.api.Formatter;
-import org.apache.myfaces.extensions.cdi.message.api.Localizable;
 import org.apache.myfaces.extensions.cdi.message.api.NamedArgument;
+import org.apache.myfaces.extensions.cdi.message.api.Localizable;
+import org.apache.myfaces.extensions.cdi.message.api.Formatter;
 import org.apache.myfaces.extensions.cdi.message.api.payload.MessagePayload;
 import org.apache.myfaces.extensions.cdi.message.api.payload.MessagePayloadKey;
 import org.apache.myfaces.extensions.cdi.message.api.payload.MessageSeverity;
@@ -227,18 +227,24 @@ class DefaultMessageBuilder implements M
 
     private String checkedResult(String result, Message baseMessage)
     {
-        if (result == null || isKey(baseMessage.getTemplate()) || (!result.contains(" ")
&& result.endsWith(baseMessage.getTemplate())))
+        if (result == null || isKey(baseMessage.getTemplate()) || isKeyWithoutMarkers(result,
baseMessage))
         {
             String oldTemplate = extractTemplate(baseMessage.getTemplate()); //minor performance
tweak for inline-msg
 
             if (result == null || result.equals(oldTemplate))
             {
-                return MessageResolver.MISSING_RESOURCE_MARKER + oldTemplate + MessageResolver.MISSING_RESOURCE_MARKER
+ getArguments(baseMessage);
+                return MessageResolver.MISSING_RESOURCE_MARKER + oldTemplate +
+                       MessageResolver.MISSING_RESOURCE_MARKER + getArguments(baseMessage);
             }
         }
         return result;
     }
 
+    private boolean isKeyWithoutMarkers(String result, Message baseMessage)
+    {
+        return (!result.contains(" ") && result.endsWith(baseMessage.getTemplate()));
+    }
+
     private String getArguments(Message message)
     {
         StringBuffer result = new StringBuffer();



Mime
View raw message