cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jburwell <>
Subject [GitHub] cloudstack pull request: findbugs equals(obj) implementations go a...
Date Wed, 01 Jul 2015 06:04:19 GMT
Github user jburwell commented on a diff in the pull request:
    --- Diff: framework/config/src/org/apache/cloudstack/framework/config/ ---
    @@ -122,6 +122,13 @@ public boolean equals(Object obj) {
             if (obj instanceof ConfigKey) {
                 ConfigKey<?> that = (ConfigKey<?>)obj;
                 return this._name.equals(that._name);
    +        }
    +        return false;
    +    }
    +    public boolean isSameKeyAs(Object obj) {
    +        if(this.equals(obj)) {
    +            return true;
             } else if (obj instanceof String) {
    --- End diff --
    @DaanHoogland we shouldn't make assumptions about the loading behavior of a class.  We
should write our equals implementations defensively.  Another issue with instanceof is that
it returns true for compatible subclasses which is also incorrect from an equals perspective.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message