Skip to content

Commit

Permalink
[FIXED JENKINS-18534] equals()/hashCode() for parameter value
Browse files Browse the repository at this point in the history
The default implementation considers parameters with the same name
to be identical, resulting in queue items being collapsed.

With this change, different values for a parameter will result in
different builds.
  • Loading branch information
daniel-beck committed Jun 17, 2014
1 parent 6745bfb commit 2dec2d0
Showing 1 changed file with 22 additions and 0 deletions.
Expand Up @@ -64,6 +64,28 @@ public String resolve(String name) {
};
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof ListSubversionTagsParameterValue)) return false;
if (!super.equals(o)) return false;

ListSubversionTagsParameterValue that = (ListSubversionTagsParameterValue) o;

if (tag != null ? !tag.equals(that.tag) : that.tag != null) return false;
if (tagsDir != null ? !tagsDir.equals(that.tagsDir) : that.tagsDir != null) return false;

return true;
}

@Override
public int hashCode() {
int result = super.hashCode();
result = 31 * result + (tagsDir != null ? tagsDir.hashCode() : 0);
result = 31 * result + (tag != null ? tag.hashCode() : 0);
return result;
}

public String getTag() {
return tag;
}
Expand Down

0 comments on commit 2dec2d0

Please sign in to comment.