Alexander Wels has posted comments on this change. Change subject: engine,userportal,webadmin: configurable unsupported locales ......................................................................
Patch Set 2: (3 comments) http://gerrit.ovirt.org/#/c/30553/2/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/servlet/UnsupportedLocaleHelper.java File backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/servlet/UnsupportedLocaleHelper.java: Line 7: import org.apache.log4j.Logger; Line 8: import org.ovirt.engine.core.common.config.Config; Line 9: import org.ovirt.engine.core.common.config.ConfigValues; Line 10: Line 11: public class UnsupportedLocaleHelper { > Both WelcomeServlet + GwtDynamicHostPageServlet follow the same usage patte Done Line 12: private static final Logger log = Logger.getLogger(UnsupportedLocaleHelper.class); Line 13: Line 14: /** Line 15: * Determine the list of locales to display by subtracting unsupported locales from the list of all locales, Line 53: for (String localeKey: locales) { Line 54: try { Line 55: //Check for valid locale. Line 56: String underScoredLocaleKey = localeKey.replaceAll("-", "_"); Line 57: org.apache.commons.lang.LocaleUtils.toLocale(underScoredLocaleKey); > Please add import to avoid fully-qualified class references. Done Why would I do the extra conversion from Locale to String when I already have the string available in a local variable? Line 58: result.add(underScoredLocaleKey); Line 59: } catch (IllegalArgumentException iae) { Line 60: //The locale passed in is not valid, don't add it to the list. Line 61: log.info("Invalid locale found in configuration: " + localeKey); //$NON-NLS-1$ http://gerrit.ovirt.org/#/c/30553/2/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/utils/VisibleLocalesInfoData.java File frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/utils/VisibleLocalesInfoData.java: Line 42: * @param allLocaleNames List of all available locales. Cannot be null. Line 43: * @param visibleLocales The list of visible locales. Cannot be null Line 44: * @return An array of locales that has been filtered. Line 45: */ Line 46: public static String[] getFilteredLocaleNames(List<String> allLocaleNames, > In general, method/API should be simple and readable - in this case, Visibl Done Line 47: List<String> visibleLocales) { Line 48: List<String> result = new ArrayList<String>(allLocaleNames); Line 49: List<String> hiddenList = new ArrayList<String>(allLocaleNames); Line 50: hiddenList.removeAll(visibleLocales); -- To view, visit http://gerrit.ovirt.org/30553 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib1c882933a365b5f03769ae8e7048aaf3553633a Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Alexander Wels <aw...@redhat.com> Gerrit-Reviewer: Alexander Wels <aw...@redhat.com> Gerrit-Reviewer: David Caro <dcaro...@redhat.com> Gerrit-Reviewer: Einav Cohen <eco...@redhat.com> Gerrit-Reviewer: Greg Sheremeta <gsher...@redhat.com> Gerrit-Reviewer: Tal Nisan <tni...@redhat.com> Gerrit-Reviewer: Vojtech Szocs <vsz...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches