myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r938965 - in /myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl: DefaultMessage.java formatter/DefaultNumberFormatter.java
Date Wed, 28 Apr 2010 12:21:58 GMT
Author: gpetracek
Date: Wed Apr 28 12:21:57 2010
New Revision: 938965

URL: http://svn.apache.org/viewvc?rev=938965&view=rev
Log:
[EXTCDI-21] minor improvements

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

Modified: myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/DefaultMessage.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/DefaultMessage.java?rev=938965&r1=938964&r2=938965&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/DefaultMessage.java
(original)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/DefaultMessage.java
Wed Apr 28 12:21:57 2010
@@ -76,6 +76,20 @@ public class DefaultMessage extends Abst
 
     public String toString(MessageContext messageContext)
     {
-        return messageContext.message().text(getTemplate()).argument(getArguments()).toText();
+        return messageContext.message().text(getTemplate()).argument(getArguments()).payload(getMessagePayload()).toText();
+    }
+
+    private Class<? extends MessagePayload>[] getMessagePayload()
+    {
+        Class[] result = new Class[getPayload().size()];
+
+        int i = 0;
+        for(Class<? extends MessagePayload> payload : getPayload().values())
+        {
+            result[i] = payload;
+            i++;
+        }
+        //noinspection unchecked
+        return result;
     }
 }

Modified: myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/formatter/DefaultNumberFormatter.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/formatter/DefaultNumberFormatter.java?rev=938965&r1=938964&r2=938965&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/formatter/DefaultNumberFormatter.java
(original)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/formatter/DefaultNumberFormatter.java
Wed Apr 28 12:21:57 2010
@@ -51,7 +51,7 @@ class DefaultNumberFormatter implements 
     public String format(MessageContext messageContext, Number valueToFormat)
     {
         GenericConfig formatterConfig = messageContext.config().getFormatterFactory()
-                .findFormatterConfig(Number.class, messageContext.config().getLocaleResolver().getLocale());
+                .findFormatterConfig(Number.class, messageContext.getLocale());
 
         if (formatterConfig != null)
         {



Mime
View raw message