Martin Betak has uploaded a new change for review. Change subject: frontend: Correct default time-zone rendering ......................................................................
frontend: Correct default time-zone rendering TimeZoneModel was returning incorrect display value in case the configured default was invalid. Now it returns display value corresponding to ultimate fallback for given TimeZoneType. Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=988259 Change-Id: Ic7be050a48c78ffdf2028ea5acfd0123bf4502a7 Signed-off-by: Martin Betak <[email protected]> --- M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/TimeZoneModel.java 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/26/19926/1 diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/TimeZoneModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/TimeZoneModel.java index c41453f..5a3f966 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/TimeZoneModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/TimeZoneModel.java @@ -32,8 +32,8 @@ cachedTimeZoneModels.put(timeZoneType, models); } - private String timeZoneKey = null; - private TimeZoneType timeZoneType = TimeZoneType.GENERAL_TIMEZONE; + private final String timeZoneKey; + private final TimeZoneType timeZoneType; public TimeZoneModel(String timeZoneKey, TimeZoneType timeZoneType) { this.timeZoneKey = timeZoneKey; @@ -51,11 +51,11 @@ public String getDisplayValue() { if (isDefault()) { - final String defaultTimeZoneKey = (String) AsyncDataProvider.getConfigValuePreConverted(timeZoneType.getDefaultTimeZoneConfigurationKey()); + String defaultTimeZoneKey = (String) AsyncDataProvider.getConfigValuePreConverted(timeZoneType.getDefaultTimeZoneConfigurationKey()); // check if default timezone is correct if (!timeZoneType.getTimeZoneList().containsKey(defaultTimeZoneKey)) { // if not show GMT - timeZoneKey = timeZoneType.getUltimateFallback(); + defaultTimeZoneKey = timeZoneType.getUltimateFallback(); } return timeZoneType.getTimeZoneList().get(defaultTimeZoneKey); } else { -- To view, visit http://gerrit.ovirt.org/19926 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic7be050a48c78ffdf2028ea5acfd0123bf4502a7 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Martin Betak <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
