You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-we...@googlegroups.com
Since the Messages interface offers a superset of the functionality available with the Constants interface, why would one ever prefer to use Constants? Does Constants offer any benefit over Messages when parameter substitution isn't needed?
Thomas Broyer
unread,
Dec 9, 2011, 8:20:36 PM12/9/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-we...@googlegroups.com
Messages is only about strings, while Constants can contain numbers, booleans, arrays of strings, etc.
socratesJ
unread,
Dec 9, 2011, 9:38:49 PM12/9/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-we...@googlegroups.com
Ah, right. But for non-parameterized strings, is there any reason to use Constants? Any compiler optimization that you don't get with Messages?
Thomas Broyer
unread,
Dec 9, 2011, 9:48:18 PM12/9/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-we...@googlegroups.com
No; in this case, Messages or Constants will produce the exact same code: the constant string is inlined, and then possibly "interned" (i.e. moved to a global constant) by the compiler; and the Constants or Messages generated class is completely compiled out.