Alon Bar-Lev has posted comments on this change. Change subject: uutils: added new cli parser ......................................................................
Patch Set 9: (3 comments) https://gerrit.ovirt.org/#/c/40157/9/backend/manager/modules/uutils/src/main/java/org/ovirt/engine/core/uutils/cli/parser/Argument.java File backend/manager/modules/uutils/src/main/java/org/ovirt/engine/core/uutils/cli/parser/Argument.java: Line 8: * This is mapping class from argument defined in properties file to java class. Line 9: * Attributes of this class is 1:1 mapping described here {@link org.ovirt.engine.core.uutils.cli.parser.ArgumentsParser} Line 10: * Line 11: */ Line 12: public class Argument { public can be dropped. Line 13: Line 14: private String name; Line 15: private String help; Line 16: private String defaultValue; Line 116: if (!(obj instanceof Argument)) { Line 117: return false; Line 118: } Line 119: Line 120: return Objects.equals(name, ((Argument) obj).getName()); while you are at this, you do not need getName() as you can access the members of other directly. and it can be: return obj instanceof Argument && Objects.equals(name, ((Argument) obj).name); but I still do not understand what's the difference of: return obj instanceof Argument && name.equals(((Argument) obj).name); maybe if name is null(?!) Line 121: } Line 122: Line 123: @Override Line 124: public int hashCode() { https://gerrit.ovirt.org/#/c/40157/9/backend/manager/modules/uutils/src/main/java/org/ovirt/engine/core/uutils/cli/parser/StringValueConverter.java File backend/manager/modules/uutils/src/main/java/org/ovirt/engine/core/uutils/cli/parser/StringValueConverter.java: Line 10: import java.util.HashMap; Line 11: import java.util.List; Line 12: import java.util.Map; Line 13: Line 14: public class StringValueConverter { public can be dropped Line 15: Line 16: private static final Map<Class<?>, Class<?>> typeBox = new HashMap<>(); Line 17: static { Line 18: typeBox.put(boolean.class, Boolean.class); -- To view, visit https://gerrit.ovirt.org/40157 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I00042b669e19293641579582223e7ca40717132d Gerrit-PatchSet: 9 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Ondra Machacek <omach...@redhat.com> Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com> Gerrit-Reviewer: Martin Peřina <mper...@redhat.com> Gerrit-Reviewer: Mooli Tayer <mta...@redhat.com> Gerrit-Reviewer: Ondra Machacek <omach...@redhat.com> Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: mooli tayer <mta...@redhat.com> 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