You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@click.apache.org by Finn Bock <bc...@gmail.com> on 2010/02/27 22:17:27 UTC

Type of field Page.messages could be Map.

Hi,

I noticed that the field Page.messages is defined as a MessageMap but
as far as I can see, it is only ever used as a Map (now a Map<String,
String>). If the field was defined as a Map<String, String>, it would
be easier to supply my own implementation of message map and still
re-use the field in Page.

There is a small change that subclasses of Page might depend on the
"messages" field being defined as a MessageMap but I doubt it.

My suggested change, as a patch:


Index: click/framework/src/org/apache/click/Page.java
===================================================================
--- click/framework/src/org/apache/click/Page.java      (revision 916790)
+++ click/framework/src/org/apache/click/Page.java      (working copy)
@@ -174,7 +174,7 @@
     protected boolean headersEdited;

     /** The map of localized page resource messages. **/
-    protected transient MessagesMap messages;
+    protected transient Map<String, String> messages;

Re: Type of field Page.messages could be Map.

Posted by Malcolm Edgar <ma...@gmail.com>.
+1 sounds like a good suggestion. I don't think there is any
MessagesMap dependency, will take a look.

regards Malcolm Edgar

On Sun, Feb 28, 2010 at 8:17 AM, Finn Bock <bc...@gmail.com> wrote:
> Hi,
>
> I noticed that the field Page.messages is defined as a MessageMap but
> as far as I can see, it is only ever used as a Map (now a Map<String,
> String>). If the field was defined as a Map<String, String>, it would
> be easier to supply my own implementation of message map and still
> re-use the field in Page.
>
> There is a small change that subclasses of Page might depend on the
> "messages" field being defined as a MessageMap but I doubt it.
>
> My suggested change, as a patch:
>
>
> Index: click/framework/src/org/apache/click/Page.java
> ===================================================================
> --- click/framework/src/org/apache/click/Page.java      (revision 916790)
> +++ click/framework/src/org/apache/click/Page.java      (working copy)
> @@ -174,7 +174,7 @@
>     protected boolean headersEdited;
>
>     /** The map of localized page resource messages. **/
> -    protected transient MessagesMap messages;
> +    protected transient Map<String, String> messages;
>