[ovirt-devel] Strange issues with com.google.gwt.i18n.client.Messages.AlternateMessage [bz#1358837]
Alexander Wels
awels at redhat.com
Thu Jul 28 08:21:23 EDT 2016
On Thursday, July 28, 2016 05:49:57 AM Ramesh Nachimuthu wrote:
> Hi,
>
> We have a strange issue with the
> com.google.gwt.i18n.client.Messages.AlternateMessage in UIMessages.java. We
> have defined some alternate messages using @Messages.Select with Enums. But
> its doesn't work any more.
>
> We have following messages in the UIMessages.java.
>
> @Messages.AlternateMessage(value = { "UNKNOWN" , "None" , "INTERVAL" ,
> "Minute" , "HOURLY" , "Hourly" , "DAILY" , "Daily" , "WEEKLY" , "Weekly" ,
> "MONTHLY" , "Monthly" }) String recurrenceType(@Messages.Select
> GlusterVolumeSnapshotScheduleRecurrence recurrence);
>
> @Messages.AlternateMessage(value = { "BYTES" , "{0} B" , "KiB" , "{0}
> KiB" , "MiB" , "{0} MiB" , "GiB" , "{0} GiB" , "TiB" , "{0} TiB" }) String
> sizeUnitString(String size, @Messages.Select
> SizeConverter.SizeUnit sizeUnit);
>
> But the generated UIMessages_.java doesn't use any of the enum conditions.
>
> public java.lang.String
> recurrenceType(org.ovirt.engine.core.common.businessentities.gluster.Gluste
> rVolumeSnapshotScheduleRecurrence arg0) { java.lang.String returnVal = null;
> int arg0_ordinal = -1;
> if (arg0 != null) {
> arg0_ordinal = arg0.ordinal();
> }
> if (returnVal != null) {
> return returnVal;
> }
> return "Incorrect enum";
> }
>
> public java.lang.String sizeUnitString(java.lang.String
> arg0,org.ovirt.engine.core.common.utils.SizeConverter.SizeUnit arg1) {
> java.lang.String returnVal = null;
> int arg1_ordinal = -1;
> if (arg1 != null) {
> arg1_ordinal = arg1.ordinal();
> }
> if (returnVal != null) {
> return returnVal;
> }
> return arg0 + " TiB";
> }
>
> It used to work earlier. Is there any known issue in the current GWT
> Version? or Am I missing something?.
>
> Regards,
> Ramesh
We have an active project to remove all the annotations from the Messages
interfaces in the project. I am guessing that is probably the cause of your
problems. I am fairly certain there is an alternative to the annotations now,
but I don't know of the top of my head. Scott can you give them the details?
Alexander
More information about the Devel
mailing list