Michael Kublin has posted comments on this change. Change subject: core,webadmin: GetConfigurationValuesQuery for UI cache ......................................................................
Patch Set 1: I would prefer that you didn't submit this (4 inline comments) .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetConfigurationValuesQuery.java Line 19: Arrays.asList(Config.DefaultConfigurationVersion, Line 20: Version.v2_2.toString(), Line 21: Version.v3_0.toString(), Line 22: Version.v3_1.toString(), Line 23: Version.v3_2.toString()); Version should be enum, we don't need to change a code when a new version is added. Line 24: Line 25: public GetConfigurationValuesQuery(P parameters) { Line 26: super(parameters); Line 27: } Line 26: super(parameters); Line 27: } Line 28: Line 29: @Override Line 30: protected void executeQueryCommand() { These is ugly, why we need a pass Map.Entry<>, we have a Pair, at least two classes Line 31: Map<Map.Entry<ConfigurationValues, String>, Object> configValuesMap = Line 32: new HashMap<Map.Entry<ConfigurationValues, String>, Object>(); Line 33: Line 34: for (ConfigurationValues configValue : ConfigurationValues.values()) { Line 32: new HashMap<Map.Entry<ConfigurationValues, String>, Object>(); Line 33: Line 34: for (ConfigurationValues configValue : ConfigurationValues.values()) { Line 35: // Ignore an admin configuration value on filtered mode Line 36: // Ignore a configuration value that doesn't exist in ConfigValues enum These is wrong. Complexity of the following code is ConfigurationValues.values().size() * ConfigValues.values().size() , I think these can be done better and with out using deprecated API Line 37: if (!shouldReturnValue(configValue) || !EnumCompat.IsDefined(ConfigValues.class, configValue.toString())) { Line 38: continue; Line 39: } Line 40: Line 41: // Adding a configuration value for each version Line 42: for (String version : versions) { Line 43: Map.Entry<ConfigurationValues, String> key = Line 44: new KeyValuePairCompat<ConfigurationValues, String>(configValue, version); Line 45: Object value = I think that u can use these line ConfigValues.valueOf(configValue.toString()) instead of EnumCompat.IsDefined ? Line 46: Config.<Object> GetValue(ConfigValues.valueOf(configValue.toString()), version); Line 47: Line 48: configValuesMap.put(key, value); Line 49: } -- To view, visit http://gerrit.ovirt.org/8563 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id51a9f86bceef07de728335643b16c0554b6876c Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Daniel Erez <de...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Alona Kaplan <alkap...@redhat.com> Gerrit-Reviewer: Einav Cohen <eco...@redhat.com> Gerrit-Reviewer: Michael Kublin <mkub...@redhat.com> Gerrit-Reviewer: Roy Golan <rgo...@redhat.com> Gerrit-Reviewer: Tomas Jelinek <tjeli...@redhat.com> Gerrit-Reviewer: Vojtech Szocs <vsz...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches